Video Demo: <URL HERE>
POINK! is a simple 2D pong game written in C++ using the Raylib library. It allows players to enjoy a classic pong experience with both single-player and two-player modes. The game includes a main menu, gameplay mechanics, and a game over screen with options to restart or exit.
- Single Player: Play against AI.
- Two Player: Play with a friend locally.
- Menu Navigation: Select game mode or exit.
- Scoreboard: Keep track of player scores.
- Game Over: Retry or exit after the game ends.
To run this game, you need the following dependencies:
- C++ compiler: A C++11 compatible compiler (e.g., GCC, Clang, MSVC).
- Raylib: A simple and easy-to-use game programming library that you can find here.
- Windows: Download the precompiled Raylib binaries from the official website or use a package manager like
vcpkgto install Raylib. - Mac: You can install Raylib via Homebrew:
brew install raylib - Linux: Use your distribution's package manager to install Raylib, for example on Ubuntu:
sudo apt-get install libraylib-dev
git clone https://github.com/your-username/poink-game.git
cd poink-gameYou can build the game using any C++ compiler that supports C++11. Here are the instructions for a few common environments:
g++ -std=c++11 main.cpp -o poink-game -lraylib -lGL -lm -lpthread -ldl -lrt -lX11- Create a build directory:
mkdir build
cd build- Run CMake:
cmake ..- Build the project:
make- Run the game:
./poink-game- Main Menu: Navigate using the UP and DOWN arrow keys to select between "1 Player", "2 Player", or "Exit".
- In-Game:
- Player 1 (Blue) uses UP to move up and DOWN to move down.
- Player 2 (Red) uses the A and D arrow keys to move sideways.
- AI (if active) automatically moves based on the ball position.
- Game Over: Once the score reaches 10, the game will show the game over screen. You can press R to retry or ESC to exit the game.
poink-game/
│
├── src/
│ ├── ai.h # AI logic for controlling the second player
│ ├── ball.h # Ball logic and collision detection
│ ├── ball.cpp # Ball implementation
│ ├── paddle.h # Paddle logic and rendering
│ ├── player.h # Player logic, score tracking, and paddle control
│ ├── player.cpp # Player implementation
│ ├── main.cpp # Main game loop, menu, gameplay, and game over
└── README.md # This fileThis project is licensed under the MIT License - see the LICENSE file for details.