Skip to content
Stackforge-07Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnakeGame

A classic Snake game built with JavaScript, HTML Canvas, and CSS.

Play the live game →

How to play

  1. Click Start to begin.
  2. Use the arrow keys to steer toward the red food.
  3. Each food adds one point and grows the snake.
  4. Avoid the walls and your own tail. Click Start to play again.

Your high score is saved in your browser's local storage. Sound effects play when you eat food and when the game ends, subject to browser audio settings.

Features

  • A 20 × 20 board rendered on a canvas.
  • Keyboard controls and wall/self-collision detection.
  • Current score and a persistent local high score.
  • Food and game-over audio.
  • Restart from the Start button.

Run locally

No packages or build step are required. With Git and Python 3 installed:

git clone https://github.com/Stackforge-07/SnakeGame.git
cd SnakeGame
python3 -m http.server 8000

Open localhost:8000. Stop the server with Ctrl+C.

Project files

File Purpose
index.html Canvas and Start button
style.css Page styling
snake.js Drawing, movement, scoring, and collisions
eat.mp3, gameover.mp3 Sound effects

Current scope

Designed for a keyboard. Touch controls and a shared online leaderboard are not implemented; scores stay in the browser where you play.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages