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

2014/1/16

Get the world the Actor lives in

sanoy sanoy

2014/1/16

#
Is there a possibility to get The world the actor lives in, because I want to change the world, but the actor has a method to check one world, but it couldnt be cast in the other World
danpost danpost

2014/1/17

#
Explain. You mention methods and worlds. What methods (both worlds??)? What casting? What code? What world structure?
sanoy sanoy

2014/1/17

#
There is an actor 1. the actor 1 is in world one. At some point of the game the world changes to World 2. Now all method in the actor 1 that refference to world 1 will crash the game. How could i make a method, that only activates while the actor is in world one, becaus if i couldnt i will have to make another actor. I want to try to let it only be one actor. A method like if(actorIsInWorld(world 1 )) or something like that
davmac davmac

2014/1/17

#
if (getWorld() instanceof World1) { ... }
sanoy sanoy

2014/1/17

#
thx
You need to login to post a reply.