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

2013/1/9

Greenfoot Error java.lang.IllegalStateException

Spgoodwin Spgoodwin

2013/1/9

#
Hey everyone, I was just wondering if anyone could give me any help with the error message i am receiving. Basically, you are controlling the space ship shooting aliens, and everything os ok when you shoot an alien or it hits you, but if it gets past you and hits the edge of the screen this error message pops up: java.lang.IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed. at greenfoot.Actor.failIfNotInWorld(Actor.java:655) at greenfoot.Actor.getOneIntersectingObject(Actor.java:904) at Objects.onContact(Objects.java:28) at Astroid.removeAstroid(Astroid.java:56) at Astroid.act(Astroid.java:19) at greenfoot.core.Simulation.actActor(Simulation.java:507) at greenfoot.core.Simulation.runOneLoop(Simulation.java:470) at greenfoot.core.Simulation.runContent(Simulation.java:204) at greenfoot.core.Simulation.run(Simulation.java:194) I'll try and get the game uploading on the Greenfoot website as well, it will be called "Space Game Final".
davmac davmac

2013/1/9

#
The error pretty message pretty much explains the problem:
An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
Most likely, you've got some code which removes 'this' actor from the world, but then goes on and does something else which requires the actor's location.
You need to login to post a reply.