Skip to content

cc-shekher/snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Snake Game

A classic Snake game built with HTML5 Canvas, CSS, and JavaScript. Play on both desktop and mobile devices!

Features

  • Cross-Platform: Works on desktop and mobile browsers
  • Responsive Design: Automatically adapts to different screen sizes
  • High Score Tracking: Saves your best score locally
  • Wall Teleportation: Pass through walls to appear on the opposite side
  • Smooth Gameplay: 150ms game loop for optimal speed

How to Play

Desktop

  • Use Arrow Keys or WASD to control the snake
  • Press any key to start the game

Mobile

  • Tap the game canvas to start
  • Swipe in any direction on the canvas to control the snake
    • Swipe up โ†’ Snake moves up
    • Swipe down โ†’ Snake moves down
    • Swipe left โ†’ Snake moves left
    • Swipe right โ†’ Snake moves right

Game Rules

  • ๐ŸŽ Eat the red food to grow and score points (+10 points each)
  • ๐ŸŒ€ Pass through walls to teleport to the other side
  • ๐Ÿ’€ Don't hit yourself or the game ends
  • ๐ŸŽ‰ Beat your high score!

Getting Started

Option 1: Play Online

๐ŸŽฎ Play Now - No download required!

Option 2: Play Locally

  1. Download or clone this repository
  2. Open snake.html in any modern web browser
  3. Start playing!

No installation or setup required - just open and play!

Technical Details

  • File: snake.html (single file game)
  • Technologies: HTML5 Canvas, CSS3, Vanilla JavaScript
  • Canvas Size: 400x400 pixels (20x20 grid)
  • Mobile Support: Touch events and swipe gestures
  • Storage: LocalStorage for high score persistence

Browser Compatibility

Works on all modern browsers including:

  • Chrome, Firefox, Safari, Edge
  • Mobile browsers (iOS Safari, Chrome Mobile, etc.)

Enjoy the game! ๐ŸŽฎ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages