An open API service indexing awesome lists of open source software.

https://github.com/isurusankhajith/supersnake

This is a classic Snake game implemented in Java using the Swing library. The game involves controlling a snake that moves around the screen, eating apples to grow in size while avoiding collisions with the walls or its own body. The objective is to achieve the highest score possible.
https://github.com/isurusankhajith/supersnake

java swing swing-gui

Last synced: over 1 year ago
JSON representation

This is a classic Snake game implemented in Java using the Swing library. The game involves controlling a snake that moves around the screen, eating apples to grow in size while avoiding collisions with the walls or its own body. The objective is to achieve the highest score possible.

Awesome Lists containing this project

README

          

---

# SuperSnake 🐍

This is a classic Snake game implemented in Java using the Swing library. The game involves controlling a snake that moves around the screen, eating apples to grow in size while avoiding collisions with the walls or its own body. The objective is to achieve the highest score possible.

## Table of Contents

- [Game Features](#game-features)
- [Installation](#installation)
- [How to Play](#how-to-play)
- [Demonstration](#Demonstration)
- [Technologies Used](#technologies-used)
- [Contributing](#contributing)
- [License](#license)

## Game Features

- **Classic Gameplay:** A simple yet addictive game where you control a snake and try to eat as many apples as possible.
- **Dynamic Snake Growth:** The snake grows longer as it eats apples.
- **Randomized Apple Placement:** Apples appear at random locations on the screen.
- **Game Over Screen:** A game over screen is displayed when the snake collides with itself or the screen borders.
- **Colorful Snake:** Each segment of the snake is colored differently for a more vibrant visual effect.

## Installation

1. **Clone the repository:**
```bash
git clone https://github.com/your-username/snake-game-java.git
```

2. **Navigate to the project directory:**
```bash
cd snake-game-java
```

3. **Compile and run the game:**
```bash
javac GamePanel.java
java GamePanel
```

## How to Play

- **Movement:** Use the arrow keys (`↑`, `↓`, `←`, `→`) to control the direction of the snake.
- **Objective:** Eat the red apples to grow in length and score points.
- **Game Over:** The game ends when the snake collides with the walls or its own body. The final score will be displayed.

## Demonstration

https://github.com/user-attachments/assets/d5821981-86bf-4b39-b467-7f004d252c67

## Technologies Used

- **Java:** The core programming language used to develop the game.
- **Swing:** Java's GUI widget toolkit used for creating the game's user interface.
- **AWT:** Abstract Window Toolkit, used for handling graphics and events.

## Contributing

Contributions are welcome! If you have any ideas for improvements or new features, feel free to fork the repository and submit a pull request.

1. **Fork the repository**
2. **Create a new branch:** `git checkout -b feature/your-feature-name`
3. **Commit your changes:** `git commit -m 'Add some feature'`
4. **Push to the branch:** `git push origin feature/your-feature-name`
5. **Open a pull request**

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---