Skip to content

A Java-based Snake Game featuring: - Smooth snake movement - Food spawning at random positions - Score tracking - Game over detection when the snake hits itself or the walls - Simple and interactive GUI using Java Swing

Notifications You must be signed in to change notification settings

Kshatriya1m/snake-game-java

Repository files navigation

🐍 Snake Game in Java

A classic Snake Game implemented using Java. This project recreates the nostalgic snake gameplay where the snake grows longer every time it eats food, and the player must avoid hitting walls or the snake’s own body.

🎮 Game Features

🟩 Smooth Snake Movement

🍎 Random Food Generation

📈 Score Tracking

❌ Game Over on Collision

⌨️ Keyboard Controls (Arrow Keys)

🖥️ Simple & Clean GUI (using Java Swing/AWT)

🧠 Concepts & Skills Demonstrated

Object-Oriented Programming (OOP)

Game loop logic

Event handling using KeyListener

Graphics rendering with java.awt

Collision detection

Timers for game updates

Managing game state (running, game over, restart)

About

A Java-based Snake Game featuring: - Smooth snake movement - Food spawning at random positions - Score tracking - Game over detection when the snake hits itself or the walls - Simple and interactive GUI using Java Swing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages