Recently, I had problems when I create some kind of menu on my project.
So, I have a sub class and a super class (that extends sub class) from the world. In my sub class there's a prepare() method that adds object into my world (super class) and in my super class there's a constructor that creates the starting menu (that refers from menu actor).
Here's my code on my super class:
and here's from the sub class :
My problem is that when I try run it, my expectation is that all of the objects in my prepare() method from the sub class will appear after I click the 'start game' button on my menu and the menu dissapears. But it doesn't appear like the way I want to.
can you help me?
public class Level01 extends Level
{
public Level01()
{
if(menu)
{
Menu m=new Menu();
addObject(m, getWidth()/2, getHeight()/2);
if(m.getIsDone())
{
menu=false;
super.prepare();
}
}
}
}public abstract class Level extends World
{
public void prepare()
{
showText("Nyawamu", 600, 20);
addObject(new Hatiku(),530,30);
addObject(score, 700, 40);
addObject(healthbar, 600, 40);
}
}
