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

https://github.com/fdograph/snake-game

A very bad snake game. Made for testing concepts
https://github.com/fdograph/snake-game

Last synced: 4 months ago
JSON representation

A very bad snake game. Made for testing concepts

Awesome Lists containing this project

README

          

# Snake Game 🐍

A classic Snake game implementation built with React, TypeScript, and Vite.

## Features

- Classic Snake gameplay mechanics
- Responsive game board
- Score tracking
- Smooth animations
- Modern React architecture with TypeScript
- Comprehensive test coverage

## Tech Stack

- **Frontend Framework**: React 18.2.0
- **Language**: TypeScript 5.0.2
- **Build Tool**: Vite 4.4.5
- **Testing**: Jest with React Testing Library
- **Code Quality**: ESLint + Prettier
- **Styling**: CSS/SCSS

## Getting Started

### Prerequisites

- Node.js (version 14 or higher)
- npm package manager

### Installation

1. Clone the repository:
```bash
git clone https://github.com/fdograph/snake-game.git
cd snake-game
```

2. Install dependencies:
```bash
npm install
```

3. Start the development server:
```bash
npm run dev
```

4. Open your browser and navigate to `http://localhost:5173`

## Available Scripts

- `npm run dev` - Start development server
- `npm run build` - Build for production
- `npm run preview` - Preview production build locally
- `npm run test` - Run test suite
- `npm run lint` - Run ESLint for code quality checks

## How to Play

- Use arrow keys or WASD to control the snake
- Eat food to grow and increase your score
- Avoid hitting walls or the snake's own body
- Try to achieve the highest score possible!

## Project Structure

```
src/
├── App/ # Main application component
├── Components/ # Reusable UI components
├── Core/ # Game logic and utilities
├── Assets/ # Images, icons, and other static assets
└── __tests__/ # Test files
```

## Testing

The project includes comprehensive test coverage using Jest and React Testing Library:

```bash
npm run test
```

## Building for Production

To create an optimized production build:

```bash
npm run build
```

The built files will be in the `dist` directory.

## Demo

🎮 **Live Demo**: [https://fdograph.github.io/snake-game/](https://fdograph.github.io/snake-game/)

## Contributing

1. Fork the project
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

This project is open source and available under the [MIT License](LICENSE).

## Author

Created by [fdograph](https://github.com/fdograph)