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

2016/2/5

Make an actor "attack" a randomly appearing actor

JackD JackD

2016/2/5

#
Hello, I am trying to make it so a mouse is on a play screen. There will be randomly appearing cheese. When the cheese appears on screen I want the mouse to run towards it. I am new to java/greenfoot so any help is appreciated.
danpost danpost

2016/2/5

#
I suggest you first peruse over the methods available within the World and Actor classes -- particularly for methods that return Actor and List objects. Most of them begin with either 'getObjects' (for List objects) or 'getOneObject' (for Actor objects). Since the mouse is an Actor object, it would be useful to know what other methods are available for use in its class that might come in handy for what you are trying to do here.
You need to login to post a reply.