Skip to content

Nosma2520/Serpiente

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Serpiente

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.

Features

  • 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.

Requirements

To run Serpiente, you need to have the following installed:

Java Development Kit (JDK) 8 or above.

How to Run

  1. Clone the repository or download the source code files.

  2. Compile the source files:

javac Snake.java Board.java
  1. Run the game:
java Snake

How to Play

  1. Use the arrow keys (up, down, left, right) to control the snake's movement.
  2. The snake will move continuously in the direction it was last directed until a different arrow key is pressed.
  3. The objective is to eat the apples as they appear in the game area.
  4. Each time the snake eats an apple, it will grow longer, and the player's score will increase.
  5. The game ends when the snake collides with the walls or its own body.

Contributions

Contributions to this project are welcome. Feel free to fork the repository and submit a pull request.

License

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! 🐍