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

2013/10/29

Respawning

skyhighh skyhighh

2013/10/29

#
hello, im trying trying to make a trap that will respawn you in another world class when you step on them. i already know how to have it respawn you at oyther coords at the same world class but i want it to respawn you at, in my case the begin of my dungeon so another world class
danpost danpost

2013/10/29

#
Add the actor in the dungeon world when creating it:
if (getOneIntersectingObject(Trap.class) != null)
{
    Dungeon dungeon = new Dungeon();
    dungeon.addObject(this, /* x and y coordinates */);
    Greenfoot.setWorld(dungeon);
}
skyhighh skyhighh

2013/10/29

#
hey dan thank you man it worked just like i wanted i only used it in trap class self instead of the the one whos stepping on it tyvm :D
You need to login to post a reply.