An open API service indexing awesome lists of open source software.

https://github.com/real-devance/retro-snake-react

Classic Snake game rebuilt with React. Uses a Queue for smooth movement and HTML5 Canvas for a retro, responsive experience.
https://github.com/real-devance/retro-snake-react

htmlcanvas react reactjs tailwindcss typescript vite vitest

Last synced: 2 months ago
JSON representation

Classic Snake game rebuilt with React. Uses a Queue for smooth movement and HTML5 Canvas for a retro, responsive experience.

Awesome Lists containing this project

README

          

# Retro Snake ๐Ÿ

Welcome to Retro Snake Game, a nostalgic revival of the classic Snake game! Built with React and inspired by LeetCode's "353. Design Snake Game" problem,.

๐Ÿ•น๏ธ [Live Demo](https://retro-snake-01.netlify.app/)

## ๐ŸŒŸ Features

- ๐Ÿ—บ๏ธ Multiple map options for varied gameplay
- ๐Ÿ“ Adjustable board sizes to suit your style
- ๐ŸŽฎ On-screen arrow buttons for easy mobile play
- ๐Ÿš€ Dynamic speed increases as your snake grows
- ๐Ÿ“Š Local storage for high scores

## ๐Ÿ› ๏ธ Under the Hood

### Custom Hooks

- `useLocalStorage.ts`: Keeps your high scores safe and sound
- `useQueue.ts`: Manages the snake's movement with queue magic
- `useRAF.ts`: Ensures buttery-smooth animations
- `useRadioState.ts`: Handles those pesky radio button states

### Context API
- **Score Context**: Keeps tabs on your growing score
- **Game Config Context**: Manages all your game settings in one place

## ๐Ÿš€ Get It Running

```bash
# Clone
git clone https://github.com/real-devance/retro-snake-react.git

# Dive into the project
cd retro-snake-react

# Install
npm install

# run
npm run dev
```

## ๐Ÿงฐ Tech Stack

- โš›๏ธ React
- ๐Ÿ“œ TypeScript
- ๐ŸŽจ Tailwind CSS
- ๐ŸŽฎ HTML5 Canvas
- โšก Vite
- ๐Ÿงช Vitest

## Acknowledgements

[LeetCode's 353 Design Snake Game](https://leetcode.com/problems/design-snake-game/description/)