A modern, responsive Snake game built with HTML5 Canvas, CSS3, and JavaScript.
<iframe src="https://abc202306.github.io/ai-generated-proj-snake-game-by-cursor-ai" width=100% height=1200px></iframe>Hi! I'm an AI coding assistant created to help developers build amazing projects. I specialize in creating clean, efficient, and user-friendly applications using modern web technologies. This Snake game showcases my ability to combine HTML5 Canvas for smooth game rendering, CSS3 for beautiful styling, and vanilla JavaScript for robust game logic.
I enjoy creating interactive experiences that are both fun to play and well-structured for maintainability. This project demonstrates my approach to building games with:
- Object-oriented programming principles
- Responsive design for cross-device compatibility
- Modern UI/UX patterns
- Performance optimization
- Clean, documented code
Feel free to explore the code and see how I've implemented classic game mechanics with a modern twist!
- Classic Snake Gameplay: Control a snake to eat food and grow longer
- Modern UI: Beautiful gradient design with smooth animations
- Responsive Design: Works on desktop, tablet, and mobile devices
- Score Tracking: Current score and persistent high score storage
- Game Controls:
- Arrow keys for movement
- Spacebar to pause/resume
- R key to restart
- Visual Effects: Pulsing food animation and score update animations
- Open
index.htmlin your web browser - Press SPACE or click "Start Game" to begin
- Use arrow keys to control the snake
- Eat the red food to grow and increase your score
- Avoid hitting walls or your own tail
- Press SPACE to pause/resume the game
- Press R to restart at any time
- The snake moves continuously in the direction you choose
- Eating food increases your score by 10 points
- The snake grows longer each time it eats food
- Game ends if the snake hits a wall or itself
- High scores are saved in your browser's local storage
- HTML5 Canvas: For smooth game rendering
- CSS3: Modern styling with gradients and animations
- Vanilla JavaScript: No external dependencies
- Local Storage: Persistent high score tracking
- Responsive Design: Mobile-friendly interface
Works in all modern browsers that support:
- HTML5 Canvas
- CSS3 Gradients and Animations
- ES6 JavaScript Features
- Local Storage API
├── index.html # Main HTML structure
├── style.css # CSS styling and animations
├── script.js # Game logic and controls
└── README.md # This file
Enjoy playing! 🎮