https://github.com/ernanej/ping-pong-opengl
A simple Ping Pong game using OpenGL and GLUT.
https://github.com/ernanej/ping-pong-opengl
cg cpp dca0114 glut opengl
Last synced: 2 months ago
JSON representation
A simple Ping Pong game using OpenGL and GLUT.
- Host: GitHub
- URL: https://github.com/ernanej/ping-pong-opengl
- Owner: ErnaneJ
- Created: 2024-07-09T03:23:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T03:45:17.000Z (about 2 years ago)
- Last Synced: 2025-10-01T03:46:56.394Z (9 months ago)
- Topics: cg, cpp, dca0114, glut, opengl
- Language: C++
- Homepage:
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ping Pong Game with OpenGL đ
This project implements a simple Ping Pong game using OpenGL and GLUT.

## Dependencies
Make sure you have the following dependencies installed:
- OpenGL
- GLUT (OpenGL Utility Toolkit)
## Compilation and Execution
### Compiling on macOS đ
Use the following command to compile the project on macOS:
```bash
clang++ -framework OpenGL -framework GLUT -o ./bin/main src/main.cpp src/game.cpp && ./bin/main
```
### Compiling on Linux (example) đ§
For Linux, you may need to adjust the command depending on your OpenGL and GLUT setup:
```bash
g++ -o ./bin/main src/main.cpp src/game.cpp -lGL -lGLU -lglut && ./bin/main
```
### Compiling on Windows (example) đĨī¸
On Windows, you can compile using MinGW or another compatible compiler:
```bash
g++ -o ./bin/main.exe src/main.cpp src/game.cpp -lopengl32 -lglu32 -lglut32 && ./bin/main.exe
```
## Controls đŽ
- Player 1:
- `W`: Move up
- `S`: Move down
- Player 2 (if applicable):
- Arrow Up: Move up
- Arrow Down: Move down
## Gameplay đšī¸
The game features two players controlling paddles to bounce a ball back and forth. Players earn points when the opposing player misses the ball.
## Files and Structure đ
```
.
âââ README.md
âââ assets
âââ bin
â âââ main
âââ src
âââ game.cpp
âââ game.h
âââ main.cpp
4 directories, 5 files
```