2016-01-04 LabZombie

posted Jan 4, 2016, 4:47 AM by Samuel Konstantinovich   [ updated Jan 4, 2016, 6:54 AM ]
1. Choose a partner for the final project. (By Wed Morning)
2. Complete the zombie lab (more will be added tomorrow)


breed [ players player]
breed [ monsters monster]

to setup
  set-default-shape monsters "turtle"
  create-monsters 8 [
    set color 10 * random 13 + 5
    setxy random-xcor random-ycor
  create-players 1 [ set shape "person" set color green]
  ask turtles [ set size 3]

to go
  every 1 / 30
    ask turtles[
      fd .1
      rt random 5
      lt random 5

to showdistances
  ;the player has to ask the monsters, so the monsters can use
  ;myself to refer to the player
  ask players[
   ask monsters[ show distance myself] 

to makeOneBig
  ask min-one-of monsters [ color ] [set size 5]

to facePrevious
  ask turtles[
    if who > 0
      face turtle (who - 1)

to facepatch
  ask turtles[
    face one-of patches with [ pcolor = white]

Today's Goal: Zombies... all zombies.

LabZombie part 1:

1. Make two breeds:
zombies / humans

2. Setup: 
    Make 2 zombies and 5 humans. 
    They should all be person shaped. 
    Place them around the world randomly.
    Zombies should be green, humans should be blue.

    Zombies do the zombieBehavior function.
    Humans do HumanBehavior function.

3. Human Behavior:
    Wiggle randomly (for now)

4. Zombie behavior:
    Follow the closest person. (for now) Use the face command, and min-one-of.

5. Modify the zombie behavior:
   ONLY FOLLOW the closest person if they are in a 10 unit radius.
   When there are no people nearby, they should just wiggle.

6. Change their detection ability from a radius of 10, into a cone, 10 units / 90 degrees in front of the zombie.

7. Modify the humans to run away from the closest zombie. 

8. Modify the humans to run away from the closest zombie, only if it is in a 12 unit radius.