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

2012/5/4

Keep Player On Top?

sadistic_angel sadistic_angel

2012/5/4

#
I am making a game with a randomly generating world. But when it starts i walk UNDER new tiles. how could i keep the player on top?
SPower SPower

2012/5/4

#
Create the player at the end.
SPower SPower

2012/5/4

#
I mean: you create your other objects, and when the are all created, you create your player
sadistic_angel sadistic_angel

2012/5/4

#
i cant do that because i want it to generate randomly. so i have it start with one tile and the player. when you start the game the rest of the tiles generate.
sadistic_angel sadistic_angel

2012/5/4

#
i published the game here to show the problem better http://www.greenfoot.org/scenarios/5029
SPower SPower

2012/5/4

#
Why can't you add the player at the end? I don't understand..
davmac davmac

2012/5/4

#
Use the setPaintOrder(...) method in the World class. Check the documentation.
sadistic_angel sadistic_angel

2012/5/4

#
thank you davmac that worked perfectly! turns out it was because i was trying to use repaint() not setPaintOrder(...). big help!
You need to login to post a reply.