Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pong

Pong is a small 2D arcade game written in C++ using raylib for graphics and input and SFML for audio. Control the player paddle, return the ball, and score against an AI-controlled opponent.

Table of Contents

Demo

Pong.mp4

Features

  • Player-versus-AI gameplay
  • AI paddle that tracks the ball
  • Ball and paddle collision detection
  • Player and AI score tracking
  • Randomized ball direction after each point
  • Hit and scoring sound effects
  • Custom arcade-inspired visuals
  • CMake-based build configuration

Controls

Key Action
Up / Down Move the player paddle
Space Start the ball after a point
Escape Close the game

Requirements

  • A C++17-compatible compiler
  • CMake 3.10 or newer
  • SFML 2.6.2 with the System, Audio, Graphics, and Window components
  • An internet connection during the first configuration so CMake can download raylib 5.0

The current CMake configuration expects Homebrew's sfml@2 installation on an Apple Silicon Mac.

Installation

Clone the repository and enter its directory:

git clone https://github.com/BeniNobel/Pong.git
cd Pong

Install CMake and SFML 2 with Homebrew:

brew install cmake sfml@2

raylib 5.0 is downloaded automatically by CMake when the project is configured.

Build and Run

Build and run the game from the repository root:

make
make run

The equivalent direct CMake commands are:

cmake -S . -B build
cmake --build build
./build/Pong

Run the executable from the repository root so it can locate the files under assets/.

To remove generated build files:

make clean

Project Structure

Pong/
├── assets/            # Sound effects
├── include/           # Class declarations and shared game state
├── src/               # Game and class implementations
├── CMakeLists.txt     # Build configuration and dependencies
├── Makefile           # Convenience commands for CMake
└── README.md          # Project documentation

About

A classic Pong game built with C++, featuring simple AI, collision detection, and sound effects using Raylib and SFML.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages