You've played this game before. You know how it goes.
- Use the arrow keys to control the snake
- Eat apples to grow longer
- The game ends if you:
- Hit the wall
- Run into yourself
- Java
- Swing GUI (old skool, I know!)
- Maven (project structure & build)
SnakeIt/
├── pom.xml
├── README.md
└── src/
└── main/
├── java/
│ └── org/
│ └── snakeIt/
│ ├── Audio.java
│ ├── GameFrame.java
│ ├── GamePanel.java
│ └── SnakeGame.java
└── resources/
├── Screenshot1.png
└── Screenshot2.png
From the project root:
cd src/main/java
javac org/snakeIt/*.java
java org.snakeIt.SnakeGameFrom the project root:
mvn clean package
java -cp target/classes org.snakeIt.SnakeGame- Open IntelliJ IDEA or Eclipse
- Open the
SnakeItfolder - Import as a Maven project
- Open
SnakeGame.java - Right-click → Run
| Key | Action |
|---|---|
| ↑ | Move Up |
| ↓ | Move Down |
| ← | Move Left |
| → | Move Right |
- Bro Code – Adapted from the Snake Game tutorial
- Stack Overflow – Java Swing grid rendering
Feel free to fork, experiment, and improve the project. Pull requests and suggestions are most welcome.
Creative Commons: © Ricki Angel 2026 | TechAngelX
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
This project is for personal or educational use only and comes without any warranty.
Built by Ricki Angel • Tech Angel X




