In the game that I'm working on, when an actor performs a certain action, a message box is supposed to show. The message box is another actor in a different class. How do I get this to work?


getWorld().addObject(new MessageBox("message"), xLocation, yLocation);
private boolean messageShown; public void act() { checkMessage(); } private void checkMessage() { if (messageShown == false) { getWorld().addObject(new MessageBox(),x,y); messageShown=true; } }