10000 GitHub - pratikkhot100/Snake-game: This is a classic Snake game implemented in Java using Swing GUI components (JFrame, JPanel, Timer, etc.). The player controls a snake that grows in length by eating food. The game ends if the snake collides with itself or the wall.
[go: up one dir, main page]

Skip to content

This is a classic Snake game implemented in Java using Swing GUI components (JFrame, JPanel, Timer, etc.). The player controls a snake that grows in length by eating food. The game ends if the snake collides with itself or the wall.

Notifications You must be signed in to change notification settings

pratikkhot100/Snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ๐ŸŽฎ Snake-game

๐Ÿ” Game Description:

This is a classic Snake game implemented in Java using Swing GUI components (JFrame, JPanel, Timer, etc.). The player controls a snake that grows in length by eating food. The game ends if the snake collides with itself or the wall.


๐ŸŽฏ Game Objective:

  • Control the snake using arrow keys.
  • Eat the food (randomly appearing).
  • Each food increases the snakeโ€™s length and score.
  • Avoid crashing into the wall or the snakeโ€™s own body.

๐Ÿ“ธ Screenshot:

image


๐Ÿ› ๏ธ Tech Stack:

  • Java SE (8+)
  • Swing (GUI)
  • AWT (for graphics and event handling)

โš™๏ธ Game Features:

  • Real-time movement using Timer and key listeners.
  • Score system based on how much food is eaten.
  • Collision detection (walls & self).
  • Restart functionality.
  • Java Swing-based GUI using:
  • JFrame (main window)
  • JPanel (game area)
  • Graphics (drawing snake, food, score)

๐Ÿ“„ How the Game Works (Flow):

  • Snake starts moving in a direction.

  • Player controls it using arrow keys (up, down, left, right).

  • If snake eats food:

    Grows longer.

    Score increases.

    New food is generated randomly.

  • If snake hits:

    Wall or itself โ†’ game over.

    Press R to restart after game over.


๐Ÿ“ž Contact Information

๐Ÿ™ GitHub: https://github.com/pratikkhot100

๐Ÿ’ผ LinkedIn: https://www.linkedin.com/in/pratikkhot01

๐Ÿ“ง Email: pratikkhot1207@gmail.com

About

This is a classic Snake game implemented in Java using Swing GUI components (JFrame, JPanel, Timer, etc.). The player controls a snake that grows in length by eating food. The game ends if the snake collides with itself or the wall.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0