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

2013/11/25

simple zombie game

jubyfollower jubyfollower

2013/11/25

#
me and my friend are creating a simple zombie game for our school comp. prog. class and were getting things done but we need help making the zombie come towards our actor? any ideas? we only have to actors placed in the world, and we basically want the zombie to walk and turn towards the actor
danpost danpost

2013/11/25

#
The 'turnTowards' method of the Actor class can be used with the coordinates of the actor you want to follow:
Actor followed = (Actor)getWorld().getObjects(Followed.class).get(0);
turnTowards(followed.getX(), followed.getY());
to have your zombie follow it.
jubyfollower jubyfollower

2013/11/26

#
thanks! :D
You need to login to post a reply.