Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-magdy/snake-game
Your Classic Snake Game, But with a twist: you get bigger and faster 💨🐍
https://github.com/g-magdy/snake-game
arcade game-2d oop raylib
Last synced: about 2 months ago
JSON representation
Your Classic Snake Game, But with a twist: you get bigger and faster 💨🐍
- Host: GitHub
- URL: https://github.com/g-magdy/snake-game
- Owner: g-magdy
- License: mit
- Created: 2024-06-26T14:33:37.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-14T08:57:18.000Z (6 months ago)
- Last Synced: 2024-07-14T10:00:36.706Z (6 months ago)
- Topics: arcade, game-2d, oop, raylib
- Language: C++
- Homepage:
- Size: 934 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🐍 Snake Game
![Video Demo](./snake-demo.gif)
## 📝 Overview
This is your classic arcade Snake game implemented in C++ using the Raylib library and Object-Oriented Programming (OOP) principles. As you know, the snake gets bigger with each bite of food, But did you know that it can get faster too? 😎
And the speed is reset back when the game ends.## ✨ Features
- you can pause the game anytime ⏯
- Score Counter## 🎮 Controls
- **Player:**
- Up, Down, Left, Right: `Arrow keys`
- Toggle Play/Pause: `P`
- Exit: `Esc`## 📋 Requirements
- C++ compiler (e.g., g++)
- Raylib library## 💻 Installation
1. **Clone the Repository:**
```sh
git clone https://github.com/g-magdy/snake-game.git
cd snake-game
```2. **Install Raylib:**
Follow the instructions on the [Raylib website](https://www.raylib.com/) to install Raylib for your operating system.3. **Compile the Game:**
```sh
make game
```4. **Run the Game:**
```sh
./game
```## 📁 Code Structure
- **main.cpp:** Contains the main game loop and initialization code.
- **Constants.h** Contains global configuration and constants
- **Game class** Contains the game logic
- **Snake class** Draws and moves the snake
- **Food class** spwans food randomly## 🤝 Contributing
Currently, I am the only contributor to this project. However, if you have suggestions or improvements, feel free to fork the repository and create a pull request.
## 📄 License
This project is open source and available under the [MIT License](LICENSE).
Enjoy playing the Snake game 🐍!