Say my world class contains a variable x, how would I be able to update this variable from within an actor class? I have tried something like this:
However when I do this sort of method, I receive a null pointer exception. Is there something wrong with this method, or is there another way to change a world variable from within an actor?
public class MyWorld extends World { public int worldVar; } public class actClass extends Actor { (MyWorld) getWorld().worldVar += 10; }