This project is a simple Pong game with added gravity, developed using SDL2. The game includes a paddle and a ball that moves under the influence of gravity, and the player controls the paddle to keep the ball in play.
- Basic Pong gameplay with gravity.
- Control the paddle to keep the ball in play.
- Simple and clean code structure for easy understanding and modification.
- SDL2 library
- CMake
- GCC or any other C compiler
sudo apt-get update
sudo apt-get install libsdl2-dev
brew install sdl2
- Clone the repository:
git clone https://github.com/felixBtzr/PongWithGravity.git
cd PongWithGravity
- Create a build directory and run CMake:
mkdir build
cd build
cmake ..
make
After building the project, you can run the game using the following command in the build
directory:
./PongWithGravity
A
orLeft Arrow
: Move paddle leftD
orRight Arrow
: Move paddle right
gravity-pong/
├── assets/
│ ├── fonts/
│ │ └── PressStart2P-Regular.ttf
│ ├── sounds/
│ └── textures/
├── include/
│ ├── config.h
│ ├── game.h
│ ├── graphics.h
│ └── input.h
├── src/
│ ├── config.c
│ ├── main.c
│ ├── game.c
│ ├── graphics.c
│ └── input.c
├── CMakeLists.txt
├── LICENSE.md
└── README.md
include/
: Contains the header files for the game.src/
: Contains the source files for the game logic, graphics, and input handling.assets/
: Directory for game assets like fonts, sounds, and textures.CMakeLists.txt
: The CMake configuration file.LICENSE.md
: License file.README.md
: This file.
Contributions are welcome! If you have any improvements or suggestions, feel free to fork the repository and create a pull request.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/my-feature
. - Commit your changes:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature/my-feature
. - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.