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

2013/11/27

Frogger: Teleporting

quakster1 quakster1

2013/11/27

#
I am recreating Frogger and I am having trouble with the all the sprites touching the top edge and just getting stuck there. I need them to teleport back to the bottom edge of the map. How do I do that? Sorry for being bad at this I just started Greenfoot
bourne bourne

2013/11/27

#
I don't know the context of your code, but when you want an Actor to teleport to the bottom of the World do something like this:
setLocation(getX(), getWorld().getHeight() + getImage().getHeight() / 2);
Where (+ getImage().getHeight() / 2) is used to make the Actor just off screen
quakster1 quakster1

2013/11/28

#
ok thanks
You need to login to post a reply.