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

2021/3/10

How do I check if an actor is still in the world?

s4m3350 s4m3350

2021/3/10

#
how would I check if an actor is still in the world? and when they arent how would I switch to the next world?
danpost danpost

2021/3/10

#
In world class act method:
if (getObjects(ActorClassName.class).isEmpty())
{
    Greenfoot.setWorld(new NextWorldClassName());
}
s4m3350 s4m3350

2021/3/12

#
I pasted that in and changed the variables to work with my game... and nothing. any idea why?
danpost danpost

2021/3/12

#
s4m3350 wrote...
I pasted that in and changed the variables to work with my game... and nothing. any idea why?
Where did you put it? Show class' codes.
You need to login to post a reply.