This is a classic Snake game implemented in Java using Swing for the graphical user interface. The game supports both single-player and two-player modes.
-
Clone the repository:
git clone https://github.com/lucas6028/snake-game.git cd snake-game/demo -
Build the project using Maven:
mvn clean install
-
Run the game:
java -jar target/Snake-game.jar
- Run the game and use the keyboard to control the snake(s).
- Eat fruits to gain points and avoid bombs.
- The game ends when a snake collides with itself, another snake, or a bomb.
- Single-player and two-player modes.
- Various types of fruits and bombs.
- Increasing difficulty levels.
- Sound effects for different game events.
- Arrow keys to move the snake.
- Spacebar to shoot bullets.
- Player 1: Arrow keys to move, Enter to shoot.
- Player 2: WASD keys to move, Spacebar to shoot.
.vscode/
settings.json
pom.xml
src/
main/
java/
com/
snake/
Bomb.java
Bullet.java
ContainerPanel.java
Draw.java
Fruit.java
ImageLoader.java
Main.java
Node.java
OpeningScreen.java
ScoreFile.java
Snake.java
Sounds.java
Stone.java
TransparentButton.java
resources/
filename.txt
images/
background/
bombs/
buttons/
fruits/
sounds/
test/
java/
com/
snake/
target/
classes/
com/
snake/
filename.txt
images/
background/
bombs/
buttons/
fruits/
sounds/
generated-sources/
annotations/
maven-archiver/
pom.properties
maven-status/
maven-compiler-plugin/
compile/
testCompile/
Snake-game.jar
test-classes/
com/
snake/
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.





