This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Matt
wrote ...
2012/5/13
Ending a game
Matt
2012/5/13
#
I know you can end a game by using Greenfoot.stop(); Is it possible to implement this coding, but specifically after an actor has hit a particular co-ordinate. how would I go about doing this.
SPower
2012/5/13
#
Sure:
if (getX() == theXCoordinate && getY() == theYCoordinate) { Greenfoot.stop(); }
Do this in act(). Replace theXCoordinate and theYCoordinate by numbers, which are the coordinates of the location you want to hit.
You need to login to post a reply.
X