A classic Snake game implemented in Java in order to get familiar with OOP pattern and Java language.
- Clone the repository:
git clone https://github.com/thanhkowibu/Java-Snake.git
cd Java-Snake
- Compile the source code:
Ensure you have Java installed. You can compile the code with the following command:
javac SnakeGame.java
- Run the game:
After compiling, run the game with:
java SnakeGame
- Controls: Use the
WASD
keys to move the snake up, left, down, and right. - Objective: Guide the snake to eat apples without hitting the walls or its own tail.
- Scoring: The score increases each time the snake eats an apple. The game ends if the snake hits a wall or itself.
- Try Again: Option to restart the game after losing.