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

2016/4/22

object is hiding behind image

madan madan

2016/4/22

#
hi guys i have created a small car game for an assignment. i have added some image and when the car moves through the image it moves from behind of the image. look at my profile picture i have kept the image of that problem. the car is moving below finishing line. how can i move that car above the image? any solutions or any codes that i have to add? please help
danpost danpost

2016/4/22

#
There is a 'setPaintOrder' method in the World class you can use to force object of one type to be painted over those of other types:
1
setPaintOrder(Car.class);
The best place for this line is in your world constructor after the 'super' call.
FutureCoder FutureCoder

2016/4/23

#
You need to remove the car object, then add it in again and save the world, that should solve the problem, without have to put in any code. If the finishing line is added to the world while the code is running, it won't work, it has to be in the world from the very beginning, before it starts to run.
You need to login to post a reply.