A simple 2D game created with C++ and SDL2.
This project is a work in progress. Features may be incomplete or subject to change. Contributions are welcome!
Blockeater is a 2D arcade-style game where the player controls a character to consume blocks that appear on the screen.
Features:
- Written in C++ with the SDL2 library for graphics and input.
- Includes a suite of unit tests using Google Test.
- Track your score with a local offline leaderboard!
-
Objective: Reach level 10 with the highest score possible!
-
Gameplay Mechanics:
- Score points by eating blocks and passing through checkpoints.
- Checkpoint gaps become smaller as you advance through levels.
- Different blocks have different effects:
- 🟩 Green Blocks: Make your character grow.
- 🟨 Yellow Blocks: Make your character shrink.
- 🟥 Red Blocks: You lose points.
-
Controls:
- Arrow Keys: Move the player character.
- Shift: Dash (earns bonus points for dashing through a checkpoint!).
- ESC: Pause / Quit the game.
Follow these instructions to get a copy of the project up and running on your local machine for development and testing.
This project is developed for a Linux environment. You will need git, g++, and cmake. You will also need the SDL2 and Google Test development libraries.
On Debian/Ubuntu-based systems:
sudo apt-get update && sudo apt-get install -y build-essential git cmake libsdl2-dev libgtest-devClone the repository to your local machine using either HTTPS or SSH.
Using HTTPS:
git clone https://github.com/kndclark/blockeater-game.git
cd blockeater-gameUsing SSH:
git clone git@github.com:kndclark/blockeater-game.git
cd blockeater-gameThe C++ version of the game can be built using the provided Makefile. First, navigate to the C++ development directory:
cd cpp_devTo build the game, run the following command. (NOTE: exclude the RELEASE=1 flag to create a debug build)
make clean && make RELEASE=1After a successful build, the executable will be in the build/ directory (relative to cpp_dev).
./build/game(Note: The executable name might differ. Check the contents of the cpp_dev/build directory after building.)
The tests also use CMake and can be built and run separately.
- Configure and run the tests using
ctest:make clean_test