This is a simple Snake game implemented in Java using Swing for graphical user interface.
- Use the arrow keys (
UP
,DOWN
,LEFT
,RIGHT
) to control the movement of the snake. - Press
P
to pause the game. - Press
ENTER
to start a new game after game over.
- The snake starts in the center of the screen.
- The objective is to eat the cherry to grow the snake.
- Avoid hitting the walls or the snake itself.
- The game ends when the snake collides with a wall or itself.
- Score Display: The current score and best score are displayed on the screen.
- Cherry Image: A cherry image is displayed instead of a simple shape.
- Pause Feature: Pause and resume the game anytime during gameplay.
- Game Over Screen: Displays the "Game Over" message when the game ends.
- Instructions: Shows instructions on how to start the game when not started.
- Java
- Swing (for GUI)
- AWT (for graphics)
- Compile the Java files.
- Run the
Main
class.
- Java Development Kit (JDK)
- Java Compiler (included in JDK)