Skip to content

kndclark/blockeater-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

167 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockeater Game

A simple 2D game created with C++ and SDL2.

Build and Test Trello Board Status: Work in Progress License: GPL v3

This project is a work in progress. Features may be incomplete or subject to change. Contributions are welcome!

About The Game

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!

How to Play

  • 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.

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine for development and testing.

Prerequisites

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-dev

Cloning the Repository

Clone the repository to your local machine using either HTTPS or SSH.

Using HTTPS:

git clone https://github.com/kndclark/blockeater-game.git
cd blockeater-game

Using SSH:

git clone git@github.com:kndclark/blockeater-game.git
cd blockeater-game

Building and Running (C++)

The C++ version of the game can be built using the provided Makefile. First, navigate to the C++ development directory:

cd cpp_dev

Building the Game

To build the game, run the following command. (NOTE: exclude the RELEASE=1 flag to create a debug build)

make clean && make RELEASE=1

Running the Game

After 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.)

Building and Running the Tests

The tests also use CMake and can be built and run separately.

  1. Configure and run the tests using ctest:
    make clean_test

About

A simple 2D game created with C++ and SDL2

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages