Snake Game
Classic Snake Game
Welcome to my JavaScript implementation of the classic Snake game! This was built to explore HTML5 Canvas and game development concepts.
How to Play
Use the arrow keys to control your snake and eat the red food squares. Each piece of food makes your snake longer and increases your score. Don’t hit the walls or your own tail!
Score: 0
Controls:
↑↓←→ Arrow Keys - Move snake
Space - Start game / Restart when game over
↑↓←→ Arrow Keys - Move snake
Space - Start game / Restart when game over
Technical Implementation
This game demonstrates several key programming concepts:
- Object-oriented design using ES6 classes
- Game loop architecture with update and render phases
- Collision detection for walls, food, and self-collision
- State management for game status and scoring
- Event handling for keyboard input
- HTML5 Canvas for 2D rendering
The game runs at approximately 8 frames per second to give it that classic Snake game feel.