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

2013/5/30

Help with atWorldEdge()

programmer274 programmer274

2013/5/30

#
It appears that this method is not in my greenfoot API. Is there any way I can replicate this differently? I just want to have an instance of my Zone class to move from the top to the bottom of the screen and then back again.
GreenGoo GreenGoo

2013/5/30

#
atWorldEdge() is not a method in the Greenfoot API, but the code for it is: public boolean atWorldEdge() { if(getX() < 1 || getX() > getWorld().getWidth() - 1) return true; if(getY() < 1 || getY() > getWorld().getHeight() - 1) return true; else return false; }
programmer274 programmer274

2013/5/31

#
Thanks for the help
You need to login to post a reply.