A classic arcade game recreated using Java Swing and AWT libraries. This project showcases fundamental game development concepts including collision detection, game loops, keyboard input handling, and different game states.
- Main Menu: Choose between two different game modes.
- Classic Mode: The traditional snake game experience where eating food grows your snake.
- Power-Up Mode: Adds an exciting twist with different food types:
- Blue Food (Speed): Doubles your snake's speed, making navigation more challenging.
- Magenta Food (Triple Growth): Adds three segments at once and resets speed to normal.
- Yellow Food (Reduction): Removes one segment from your snake.
- Score Tracking: Current score visible during gameplay.
- High Score System: Your best score is saved and displayed.
- Game Over Screen: Shows final score with options to restart or return to menu.
-
Starting the Game:
- At the main menu, press
1to play Classic Mode - Press
2to play Power-Up Mode
- At the main menu, press
-
Controls:
- Use arrow keys to control the snake's direction
- Press
Spaceto restart after game over - Press
Escapeto return to the main menu after game over
-
Objective:
- Classic Mode: Eat food to grow your snake and achieve the highest score possible
- Power-Up Mode: Same as classic, but strategically use power-ups to your advantage
-
Game Over Conditions:
- Colliding with the snake's own body
- Hitting the boundaries of the play area
This game demonstrates several key Java programming concepts:
- Object-oriented design with classes for game objects
- Event handling for keyboard input
- Game state management
- Rendering graphics with Java 2D
- Timer-based animation
- Random number generation for food placement