Skip to content

abhishek-maurya576/snake_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern Snake Game

A modern implementation of the classic Snake game with enhanced features and realistic graphics using HTML5 Canvas and JavaScript.

Features

  • 🐍 Realistic snake movement with smooth body following behavior
  • 👀 Animated snake eyes that follow movement direction
  • 🎯 Dynamic obstacles that appear and fade over time
  • 🌈 Gradient effect on snake body segments
  • 🍎 Random food spawning
  • 📊 Score tracking
  • 🎮 Responsive controls

How to Play

  1. Open index.html in a modern web browser
  2. Use arrow keys to control the snake's direction
  3. Eat food to grow longer
  4. Avoid:
    • Hitting walls
    • Colliding with yourself
    • Running into obstacles

Controls

  • ⬆️ Up Arrow: Move up
  • ⬇️ Down Arrow: Move down
  • ⬅️ Left Arrow: Move left
  • ➡️ Right Arrow: Move right

Technical Details

The game is built using:

  • HTML5 Canvas for rendering
  • JavaScript ES6+ features
  • Object-oriented programming principles

Project Structure

snake_game/
├── index.html
├── css/
│   └── style.css
├── js/
│   ├── game.js
│   ├── snake.js
│   └── obstacles.js
└── README.md

Installation

  1. Clone the repository:
git clone https://github.com/abhishek_maurya576/snake_game.git
  1. Open index.html in your browser

Browser Compatibility

  • Chrome (recommended)
  • Firefox
  • Safari
  • Edge

Future Enhancements

  • Multiple difficulty levels
  • Power-ups
  • Sound effects
  • High score system
  • Mobile touch controls

Contributing

Feel free to fork the project and submit pull requests for any improvements!

License

This project is open source and available under the MIT License.

Releases

No releases published

Packages

No packages published