Levels
HI,
How can i create more levels? Are you planning on doin that?
Here is how i managed to have up to 10 levels:
Add a new class called "Levels" put 10 public static final strings there and put your level setups inside them (you can copy the level from the Board-class in one of them and use it as a sample to create the others in the other strings).
In the Board class set the level-string to the first string of the Level-class
go into the TAdapter class inside the Board class and add cases for the number keys to the switch-statement. put the same stuff like in the case for the r-key into them and above this content set the level-string to the matching string of the Levels-class.
if you start the game now, you can change the level with the number-keys
additional tip: above the switch there you will find:
if (isCompleted) {
return;
}
Better remove this there and place it inside the cases for the arrow-keys. so you are still able to restart or change the level, if you solved one.
actual you only can close the window, if you solved the level.
I want to keep the games simple so that beginners can understand it. I might have some upgrades in my e-books.
HI,
How can i create more levels? Are you planning on doin that?
@ KudosColin
you can look into my one, to see, how i managed it: AngryBirdsSokoban Now with a level-chooser-dialog for unlimited level-list.
And the levels in the Level-class are now listed in an ArrayList. So i only need to add a new level-map to the ArrayList and it appears in the combobox of the level-chooser and can be played.