This site requires JavaScript, please enable it in your browser!
Greenfoot back
branz17
branz17 wrote ...

2017/5/14

plant vs zombie

branz17 branz17

2017/5/14

#
Please help me !! How to make zombie get move up,down,right and left . Teach me the source :)
danpost danpost

2017/5/14

#
When created or added into world, choose one of the four directions at random and also choose a random distance to move from one to the distance to the edge it will be moving toward. These two choices will need to be maintained in fields to be used each act step. During each act step: set rotation to direction, move and decrease the distance needed to travel and reset rotation back to zero; then, check if the distance left to travel is zero or not -- if so, choose a new direction and distance (the change in direction can be limited to a simple left or right turn, if desired).
You need to login to post a reply.