Lecture:: 01-04-2013

posted Jan 4, 2013, 6:20 AM by Samuel Konstantinovich   [ updated Jan 4, 2013, 6:36 AM ]

Note: Submit your scheme portion of the vacation homework on the homework server tonight. 

Zombies vs Humans II : revenge of the zombies (complete over the weekend if you don't finish in class)

Swap code with your partners. You must implement several new features using their code as a starting point. 

New Features

5: Humans also need a shape for “tiredPerson” that is just a hunched over person. When their stamina is 5 or less, set their shape to “tiredPerson” otherwise set their shape back to “person”. This shows you when people are tired visually.


6. Zombies have a zombie_vision_angle (make it a slider from 1 to 360, default to 100) and should now use in-cone instead of in radius. Look up the in-cone command in the dictionary!


7: Humans now have a corpseTimer variable. Humans with a CorpseTimer of 0 behave normally(they do peoplestuff). Humans with a corpseTimer other than 0 do corpseStuff instead.


Corpsestuff:

change shape to “corpse”

decrease corpseTimer by 1

when the timer reaches 0, make a zombie and die (or change into a zombie).


8. Zombies now have new features:

When there is a human with a corpseTimer of 0 on the same patch as the zombie, the zombie will set ONE of those human's corpse_timer to 20.

When there is a human with a corpseTimer other than 0 on the same patch the will run an eat command instead of chasing/shambling.

The eat command just changes the zombie's label to “Brains!”. The zombies should reset their labels to “” (empty string) when they are not eating, so this clears away.




Comments