A simple browser-based Snake Game built using HTML5 Canvas and JavaScript. The project focuses on implementing game logic, keyboard controls, collision detection, scoring, and dynamic game speed using JavaScript.
This project is a classic Snake Game where the player controls a snake using the arrow keys to collect food and increase the score.
The game was built to practice JavaScript fundamentals, DOM manipulation, event handling, Canvas API, game loops, and logical problem-solving.
- 🎮 Arrow-key controls
- 🍎 Randomly positioned food
- 📈 Score tracking
- ⚡ Increasing game speed as the score increases
- 💥 Wall collision detection
- 🐍 Self-collision detection
- 🔄 Game reset after Game Over
▶️ Start button to begin the game- 🎨 HTML5 Canvas-based game board
- HTML5
- JavaScript
- HTML5 Canvas API
Snake-Project/
│
├── index.html
├── script.js
└── README.md
git clone https://github.com/debojitdey037/Snake-Project.gitcd Snake-ProjectOpen index.html in your web browser.
No additional installation or dependencies are required.
- Open the game in your browser.
- Click the Start button.
- Use the Arrow Keys to control the snake.
- Collect the food to increase your score.
- Avoid hitting the walls or the snake's own body.
- The game ends when a collision occurs.
- JavaScript variables and functions
- Arrays and objects
- DOM event handling
- Keyboard event listeners
- HTML5 Canvas drawing
- Game loops and timing
- Collision detection
- Random number generation
- Game state management
- Add a high-score system
- Add pause/resume functionality
- Add difficulty levels
- Improve the visual design
- Add sound effects
- Make the game responsive for mobile devices
- Add a restart button
- Add a game start screen
Debojit Dey
B.Tech Computer Science & Engineering (AI & ML) Student
Interested in Web Development, Software Development, and AI/ML.
- GitHub: https://github.com/debojitdey037
- LinkedIn: https://www.linkedin.com/in/debojit-dey-b55766380/
⭐ If you enjoyed the project, consider giving the repository a star!