This is a simple implementation of the classic Snake Game in Java, using the java.io
, java.swing
, and java.awt
packages to create a graphical user interface (GUI) for the game. The objective of the game is to control the snake's movement and eat as many apples as possible without colliding with the walls or its own body.
- Classic snake gameplay with intuitive controls.
- Randomly generated apples for the snake to eat.
- Keeps track of the player's score.
- Game over when the snake collides with the walls or itself.
- Simple and clean user interface.
To run Serpiente, you need to have the following installed:
Java Development Kit (JDK) 8 or above.
-
Clone the repository or download the source code files.
-
Compile the source files:
javac Snake.java Board.java
- Run the game:
java Snake
- Use the arrow keys (up, down, left, right) to control the snake's movement.
- The snake will move continuously in the direction it was last directed until a different arrow key is pressed.
- The objective is to eat the apples as they appear in the game area.
- Each time the snake eats an apple, it will grow longer, and the player's score will increase.
- The game ends when the snake collides with the walls or its own body.
Contributions to this project are welcome. Feel free to fork the repository and submit a pull request.
Serpiente is licensed under the GNU General Public License v3.0
Enjoy the game! If you encounter any issues or have suggestions for improvement, please feel free to open an issue. Happy gaming! 🐍