Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-magdy/pong-game
Your Classic Arcade Game, but with a twist; the ball speeds up!
https://github.com/g-magdy/pong-game
game-2d oop raylib-cpp
Last synced: 2 months ago
JSON representation
Your Classic Arcade Game, but with a twist; the ball speeds up!
- Host: GitHub
- URL: https://github.com/g-magdy/pong-game
- Owner: g-magdy
- License: mit
- Created: 2024-06-23T11:42:39.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-25T12:41:13.000Z (7 months ago)
- Last Synced: 2024-06-26T12:37:14.563Z (7 months ago)
- Topics: game-2d, oop, raylib-cpp
- Language: C++
- Homepage:
- Size: 8.03 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🏓 Pong Game
![Pong Game GIF](pong-mini.gif)
## 📝 Overview
This is a simple Pong game implemented in C++ using the Raylib library and Object-Oriented Programming (OOP) principles. It's a basic version of the classic arcade game where two players use paddles to hit a ball back and forth. But with a twist; The ball speeds up each time it collides with the paddle 😎
And the speed is reset back when a goal is scored## ✨ Features
- Currently only a single player against a brutal CPU 😄
- Soon, I may add the two player functionality as an option## 🎮 Controls
- **Player (Left Paddle):**
- Move Up: `Up Arrow`
- Move Down: `Down Arrow`## 📋 Requirements
- C++ compiler (e.g., g++)
- Raylib library## 💻 Installation
1. **Clone the Repository:**
```sh
git clone https://github.com/g-magdy/pong-game.git
cd pong-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.
- **Ball.h / Ball.cpp:** Defines the Ball class for the game ball.
- **Paddle.h / Paddle.cpp:** Defines the Paddle class for player paddles.
- **ComputerPaddle.h / ComputerPaddle.cpp:** Inherits from the paddle class and simulates a player -a hard one 😄-## 🤝 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 Pong!