A simple console-based Snake game built using core Java.
- Snake movement using dx, dy logic
- Collision detection (walls + self)
- Food generation
- Snake growth using ArrayList
- Game loop implementation
- Core Java fundamentals
- Game logic thinking
- Coordinate system handling
- Data structures (ArrayList)
This project was built as a learning exercise with guidance (including AI) to better understand programming concepts.
The Snake Game is based on simple movement and collision rules.
The snake moves continuously in one direction based on user input:
- U (Up)
- D (Down)
- L (Left)
- R (Right)
The direction changes only when a new valid key is pressed.
The game ends in two cases: 1.Wall Collision If the snake crosses the boundary of the game area, the game is over.
2. Self Collision
If the snake’s head touches any part of its own body, the game ends immediately.
###Food System
- Food appears at random positions
- When eaten:
- Snake grows longer
- Score increases