Skip to content

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.

Notifications You must be signed in to change notification settings

kgrim/CS50FinalProj_Poink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POINK! Pong Game

Video Demo: <URL HERE>

Description:

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.

Features

  • 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.

Requirements

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.

Raylib Installation

  1. Windows: Download the precompiled Raylib binaries from the official website or use a package manager like vcpkg to install Raylib.
  2. Mac: You can install Raylib via Homebrew:
    brew install raylib
    
  3. Linux: Use your distribution's package manager to install Raylib, for example on Ubuntu:
    sudo apt-get install libraylib-dev
    

1. Clone the repository:

git clone https://github.com/your-username/poink-game.git
cd poink-game

Build the project:

You 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

Using CMake:

  1. Create a build directory:
mkdir build
cd build
  1. Run CMake:
cmake ..
  1. Build the project:
make
  1. Run the game:
./poink-game

How to Play

  • 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.

File Structure

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 file

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages