The menu GUI now contains several buttons which can be pressed with the mouse:
The buttons are triggered using the java MouseListener which I added here.
The buttons simply consist of one Rectangle containing a text that changes color if the mouse was pressed above it. The level and difficulty selection is also indicated by another color.
The Start button simply starts the game, but space can still be used for that.
Difficulty and level can now be selected using the mouse or you can cycle through them with G(for the difficulty) and L(for the level).
Now that level and difficulty are seperated it has also become possible to select a level in hard mode:
The death-screen pretty much remained the same, but you now have to leave it pressing any key to start a new game. I made it this way so the death-screen isn't overloaded with the same details as the main-screen having also the "Game Over" at the position where the start button would be.
- Use a deque to store the snake's segments as suggested by @justyy here.
- All references to colors are now referencing Assets which allows in future to change them in the settings.
- The cube now automatically rotates slowly in the main menu.
- The sorting algorithm in
Graphics3D.update()is now more general.
- Previously when a new level was added all your scores were gone, but that is fixed now.
- The github readme.md has now an image.