I want to have multiple levels. I am using a switch statement for that.
My problem is the selection of the levels. I created objects as buttons for the level selection. They were supposed to be selected with a mouse click.
I am kind stuck. The other all parts work. The mistake has to be within these lines and I'm not sure where.
If anyone could help I would be thankful.
1 2 3 4 5 6 7 8 9 10 | //adds object levelOneButton Actor buttonOne = new levelOneButton(); addObject(buttonOne, 250 , 400 ); //clicking the button is supposed change the level variable if (Greenfoot.mouseClicked(buttonOne)) { removeObjects(getObjects( null )); level = 2 ; } |