Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aburraq/lamesnake
I have created a snake game by watching Bro Code. Then I wanted to add something from myself. So I added some images, prevent apple to appear on snake, restart game option and a few more touch. Go check it out now. Also credential link to Bro Code: https://www.youtube.com/watch?v=bI6e6qjJ8JQ
https://github.com/aburraq/lamesnake
gamedevelopment graphicsprogramming imageio java jframe jpanel keylistener snake-game swing
Last synced: 12 days ago
JSON representation
I have created a snake game by watching Bro Code. Then I wanted to add something from myself. So I added some images, prevent apple to appear on snake, restart game option and a few more touch. Go check it out now. Also credential link to Bro Code: https://www.youtube.com/watch?v=bI6e6qjJ8JQ
- Host: GitHub
- URL: https://github.com/aburraq/lamesnake
- Owner: Aburraq
- Created: 2023-11-11T13:08:22.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-07T12:59:52.000Z (about 1 year ago)
- Last Synced: 2024-11-11T23:11:54.040Z (2 months ago)
- Topics: gamedevelopment, graphicsprogramming, imageio, java, jframe, jpanel, keylistener, snake-game, swing
- Language: Java
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java Game: Snake
## Description
This Java game implements the classic Snake game using Swing for the graphical interface. Players control a snake that moves around the screen to collect apples, increasing its size each time it eats one. The game ends if the snake collides with itself or the screen borders.
## Features
- **Snake Movement:** The snake moves in four directions: up, down, left, and right.
- **Apple Collection:** Players can eat apples to grow the snake's length and increase their score.
- **Game Over:** The game ends when the snake collides with itself or the screen borders.
- **Score Display:** Displays the player's score while playing.
- **Restart Option:** Players can restart the game after it ends.## How to Play
- **Controls:** Use the arrow keys to direct the snake (Up, Down, Left, Right).
- **Collect Apples:** Guide the snake to eat apples without hitting itself or the walls.
- **Game Over:** The game ends if the snake collides with itself or the borders.
- **Restart:** Press the Space key to restart the game after it ends.## Setup
- **Java Requirements:** Ensure you have Java installed to run this game.
- **IDE or Command Line:** Open the project in an IDE or compile and run it via the command line.## Getting Started
1. **Run the Game:** Execute the `GamePanel` class to start the game.
2. **Gameplay:** Control the snake using the arrow keys to eat apples and score points.
3. **Game Over:** The game ends if the snake collides. Restart by pressing the Space key.## Additional Information
- **Image Resources:** The game uses images for the snake's head and apple objects.
- **Adjustments:** Modify the code to change game speed, appearance, or add new features.
- **Dependencies:** Requires the `javax.swing`, `java.awt`, and `java.io` packages.