Skip to content

NRR385/Basic-Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Snake Game โ€“ Interactive Browser Game

An interactive and feature-rich Snake Game built using HTML, CSS, and JavaScript (Canvas API). The game includes dynamic speed increase, bonus food system, pause/resume functionality, and a persistent leaderboard using browser LocalStorage.


๐ŸŽฎ Features

โœ… Smooth snake movement using JavaScript game loop โœ… Dynamic difficulty โ€“ game speed increases as score grows โœ… Golden bonus food that gives extra points โœ… Pause / Resume functionality using keyboard controls โœ… Restart system with Game Over screen โœ… Persistent High Score tracking โœ… Leaderboard system (Top 5 players saved locally) โœ… Modern dark UI with responsive layout


๐Ÿง  Tech Stack

  • HTML5 Canvas
  • CSS3
  • JavaScript (ES6)
  • Browser LocalStorage

๐ŸŽฏ Controls

Key Action
โฌ†๏ธ Move Up
โฌ‡๏ธ Move Down
โฌ…๏ธ Move Left
โžก๏ธ Move Right
P Pause / Resume

๐Ÿ† Game Mechanics

  • Normal food โ†’ +1 score
  • Every 5 foods โ†’ Speed increases
  • After 5 foods โ†’ Golden food appears
  • Golden food โ†’ +5 score
  • Collision with self โ†’ Game Over

๐Ÿ’พ Leaderboard System

The game stores:

  • High Score
  • Top 5 player scores

using browser LocalStorage, allowing persistent tracking even after page reload.


๐Ÿ“‚ Project Structure

Snake-Game/
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ style.css
โ”œโ”€โ”€ script.js
โ””โ”€โ”€ README.md

โ–ถ๏ธ How to Run Locally

  1. Clone the repository
git clone https://github.com/NRR385/Basic-Snake-Game.git
  1. Open index.html in your browser

โญ Future Improvements

  • Sound effects
  • Difficulty levels
  • Mobile touch controls
  • Online leaderboard (Firebase / Backend)
  • AI auto-play snake

โญ If you like this project, consider giving it a star!

About

Modern Snake Game in JavaScript with dynamic gameplay and persistent high-score tracking.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors