Welcome to the Game Package repository! This project contains a collection of games developed using the Raylib library in C++. The first game included is Ping Pong, Tetris, 2048 and more games will be added in the future.
This project is a game package developed using the Raylib library in C++. Raylib is a simple and easy-to-use library to enjoy videogames programming. It allows you to create visually appealing games with minimal effort.
A classic Ping Pong game where two players control paddles to hit the ball back and forth. The game continues until one player scores the winning point.
A classic game where player have to complete a row of tile from seven unique blocks and prevent the block to reach the top of screen.
A classic game where player have to slide the tiles a two tile with same value merge to form double of that tile. The game is over when you reach out of move or completes 2048.
To run the games in this repository, you need to have Raylib installed on your system. Make sure that you have not minGW is not installed and is not included in the environment variable. Follow the steps below to set up your environment:
-
Install Dependencies:
Ensure you have installed all necessary dependencies for your platform. For detailed instructions, refer to the Raylib documentation.
-
Update System Environment Variables:
Add the following path to your system environment variables:
C:\raylib\w64devkit\bin
-
Navigate to Source Directory:
Open a terminal and navigate to the following path:
C:\raylib\raylib\src
-
Compile Raylib:
In the terminal, run the following command:
mingw32-make PLATFORM=PLATFORM_DESKTOP
-
Locate Compiled Library:
After the command executes successfully, a new file named
libraylib.awill be created. -
Replace Existing Library:
Copy the newly created libraylib.a file and replace the existing
libraylib.afile in the lib folder within your project directory. -
Create Makefile:
Create a Makefile in your project directory and add the following content:
# Define the source files for the project SOURCES = ./src/main.cpp # Default target to compile the project default: g++ $(SOURCES) -o ./build/game.exe -g -O1 -Wall -Wno-missing-braces -I include/ -L lib/ -lraylib -lopengl32 -lgdi32 -lwinmm # Run the compiled executable ./build/game.exe
-
Run the Program:
To compile and run the program, execute the following command in the terminal:
make
After building the project, you can run the game using the command mentioned above.
Use the following controls to play
1. Ping Pong:
-
Single Player Controls:
W- Move paddle upS- Move paddle downSpace- Pause the game
-
Double Player Controls:
W- Move left paddle upS- Move left paddle downUp Arrow- Move right paddle upDown Arrow- Move right paddle downSpace- Pause the game
2. Tetris
Left Arrow- Move block leftRight Arrow- Move block rightUp Arrow- Rotate blockDown Arrow- Move block down quicklyRight Shift- Directly place the block at the bottomSpace- Pause
3. 2048
Left Arrow- Slide block leftRight Arrow- Slide block rightUp Arrow- Slide block upDown Arrow- Slide block down
Contributions are welcome! If you have ideas for new games or improvements to the existing ones, please feel free to fork this repository, make your changes, and submit a pull request. Here are the steps to contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.