SnakeIra is a desktop Snake game implemented in Java Swing. Guide the snake around the board, collect food, grow longer, and avoid collisions with the walls, your own body, and obstacles.
- Classic grid-based Snake gameplay
- Keyboard controls
- Score display
- Obstacles placed around the board
- Special food that increases the game speed
- Game-over screen with an Enter-to-restart flow
- Custom image assets for the snake, food, and obstacles
- Java 17
- Java Swing and AWT
- Maven project configuration
src/
βββ images/ # Game sprites and image assets
βββ main/
βββ java/com/project/snakeira/
βββ SnakeIra.java # Application window and entry point
βββ Board.java # Game loop, rendering and controls
βββ Obstacles.java # Obstacle layout and collision checks
pom.xml # Maven configuration
- JDK 17
- Apache Maven
Clone the repository:
git clone https://github.com/sor1209/Java-SnakeIra.git
cd Java-SnakeIraCompile the project:
mvn clean packageYou can also open the project in an IDE that supports Maven and run the main class:
com.project.snakeira.SnakeIra
Keep the src/images/ directory in the expected location because the game loads its sprites using relative file paths.
| Key | Action |
|---|---|
| Arrow keys | Change the snake's direction |
| Enter | Restart after Game Over |
The board includes fixed obstacles. Plan turns carefully and avoid reversing directly into the snake's body.
SnakeIra Β· Java Desktop Game