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

2019/6/16

Spawing an actor if an actor is removed

loldertroll loldertroll

2019/6/16

#
So I am making a game right now with bosses. If a certain boss dies i want to spawn a door,but i dont know how to do it. This is the code where I want to include it:
if (hp <1 ){
                    getWorld().removeObject(this);
                    
                }
Super_Hippo Super_Hippo

2019/6/16

#
This places a Door at the position of the Boss. Make sure to have this line before you remove the object.
getWorld().addObject(new Door(), getX(), getY());
You need to login to post a reply.