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

2019/6/15

if an actor is removed spawn another one

loldertroll loldertroll

2019/6/15

#
So I am making a game with bosses right now, but I have a problem. Theres one boss 3 times in the same room and if they die I want to spawn another actor, but i dont know how to do it.
 public MyWorld()
    {  
       
        super(1024, 550, 1,false);
        
        addObject(new Spinne(), 800,300);
        addObject(new Spinne(), 800,225);
        addObject(new Spinne(), 800,100);
        addObject(new Jim(),200,225);
        
       
       
            
        
}
SickTrickz832 SickTrickz832

2019/6/15

#
IS it the boss that you want to spawn 3 times? If so you can have something like
if bossHealth <= 0
{
    getWorld().removeObject(this);
    addObject (new Boss(), xCoord, YCoord)
}
loldertroll loldertroll

2019/6/15

#
no if all of these bosses die(Spinne is the name of the boss)
You need to login to post a reply.