I've created a classic Snake game with the following features:
- The snake moves around a 20x20 grid
- Use arrow keys to control the snake's direction
- Eat the red food to grow and increase your score
- The game ends if you hit the walls or yourself
- When you reach a score of 10, it shows the "Happy SuccessFactors Mobile" message
- You can restart the game after losing or winning
The game uses:
- Canvas for rendering
- React hooks for state management
- Interval-based game loop
- Keyboard event listeners for controls
- shadcn/ui Dialog component for the success message
- Clean, minimal styling with Tailwind CSS
To play:
- Use arrow keys to control the snake
- Collect the red food to grow
- Avoid hitting the walls or yourself
- Reach 10 points to see the success message
You can click "Play Again" to restart the game at any time after losing or winning.