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

2014/3/9

Returning Objects back to the World

patrick26 patrick26

2014/3/9

#
Hi, does anyone know how to return an object back to the top of the world once it gets near the bottom of the world? Thanks.
bourne bourne

2014/3/9

#
Check its y-coordinate (getY() method) to see if it is near the World's bottom (World.getHeight() method). And use Actor's setLocation(int, int) to move the Actor to the top, like this: setLocation(getX(), 0)
You need to login to post a reply.