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

2016/11/13

add object on the same position

Sk1llG4m3r Sk1llG4m3r

2016/11/13

#
i got a Rover which disappears and now i want to add an astronaut at the same Position... how can i do this?
ZoeF ZoeF

2016/11/13

#
i presume you want remove the Rover with the getWorld().removeObject(this); statement. In the rover itself. so what you need are the curent x and y of the rover
// before the removeObject add the following

astronaut = new astronaut();
addObject (astronaut, getX(), getY());
Sk1llG4m3r Sk1llG4m3r

2016/11/13

#
it says: x(y) is not public in Greenfoot.actor;cannot be accessed by outside package
danpost danpost

2016/11/13

#
Sk1llG4m3r wrote...
it says: x(y) is not public in Greenfoot.actor;cannot be accessed by outside package
Show what code you tried when you got that error message.
You need to login to post a reply.