Skip to content

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

Notifications You must be signed in to change notification settings

Aburraq/LameSnake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages