I have an Actor here:
then I add this Actor to the world.
it shows error!
, pointing that addObject method.
must be that I can't do it like this.
but I use getWorld() to showText("like this string", X, Y) on an Actor, no error.
what error I made? thx.
point: Make this actor spawn an object like the World abstract does, but an actor did this.
public class DoSomething extends Actor{ //constructor public DoSomething(){ getWorld().addObject(new otherObject, 100, 100); } }
java.lang.NullPointerException
getWorld().showText("Hello World", 100, 100);