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

2013/5/26

Checking if in world

FCG FCG

2013/5/26

#
How do I check if the actor is still in the World
Gevater_Tod4711 Gevater_Tod4711

2013/5/26

#
If the getWorld method returns null the actor isn't in the world. Otherwhile he is.
FCG FCG

2013/5/26

#
Gevater_Tod4711 wrote...
If the getWorld method returns null the actor isn't in the world. Otherwhile he is.
Could you write some code I don't understand
Gevater_Tod4711 Gevater_Tod4711

2013/5/27

#
//in any of your actor classes:
if (getWorld() != null) {
    //actor still in world;
}
else {
    //actor not in world;
}
You need to login to post a reply.