Skip to content

098tarik/jumping-ball-the-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jumping Ball - The Game

A fun platform jumping game built with C++ and Raylib. Jump your way up through randomly generated platforms, avoid falling, and reach the top!

Overview

Jumping Ball is a side-scrolling platformer game where you control a ball that jumps from platform to platform. The goal is to climb as high as possible without falling off the bottom of the screen. The game features:

  • Dynamic Platform Generation: Randomly generated platforms for endless gameplay
  • Smooth Physics: Realistic gravity and collision detection
  • Score Tracking: Your score increases as you climb higher
  • Vertical Scrolling Camera: The camera follows your player as you ascend

Animation

Prerequisites

Before you can compile and play, you'll need:

  1. C++ Compiler: MinGW with g++ (recommended: MSYS2 with ucrt64)
  2. Raylib Library: The graphics library used for rendering
  3. Make Tool: MinGW32-make (comes with MSYS2)

Installing MSYS2 and Raylib

If you don't have MSYS2 and Raylib installed:

  1. Download MSYS2 from https://www.msys2.org/
  2. Install and update packages
  3. Download and set up Raylib in a known location (default: C:/raylib/raylib)

Compilation

Quick Compile (Default)

If you have Raylib installed at C:/raylib/raylib, simply run:

mingw32-make -f Makefile.simple

This creates a game.exe executable in the project root.

Custom Raylib Path

If your Raylib installation is in a different location, specify the path:

mingw32-make -f Makefile.simple RAYLIB_PATH=C:/path/to/raylib

Build Options

  • Debug Build (default, includes debug symbols):

    mingw32-make -f Makefile.simple BUILD=debug
  • Release Build (optimized, smaller executable):

    mingw32-make -f Makefile.simple BUILD=release

Clean Build

To remove compiled object files and the executable:

mingw32-make -f Makefile.simple clean

Then compile again with mingw32-make -f Makefile.simple

Playing the Game

Running the Game

After compilation, run the executable:

.\game.exe

The game will launch in fullscreen mode.

Controls

  • Space or Up Arrow: Jump (press to jump, hold for higher jumps)
  • Left Arrow or A: Move left
  • Right Arrow or D: Move right
  • ESC: Exit the game

Gameplay Tips

  • Time your jumps: Land in the center of platforms for stability
  • Build momentum: Chain jumps together to climb faster
  • Watch the camera: The screen scrolls up as you climb—don't let it catch you!
  • Avoid falling: Fall off the bottom of the screen and it's game over
  • Restart easily: When the game ends, press a key to restart

Project Structure

src/
├── main.cpp           # Entry point
├── config/
│   └── Config.h       # Game configuration constants
├── game/
│   ├── Game.h         # Main game controller
│   └── Game.cpp
├── player/
│   ├── Player.h       # Player/ball logic
│   └── Player.cpp
└── level/
    ├── Level.h        # Platform and level generation
    └── Level.cpp

Configuration

Game settings can be modified in src/config/Config.h. You can adjust:

  • Number of platforms
  • Window dimensions
  • Game physics (gravity, jump force)
  • And more!

After changing configuration, recompile with mingw32-make -f Makefile.simple.

Troubleshooting

"mingw32-make: command not found"

  • Ensure MSYS2 is installed and added to your system PATH

"Cannot find raylib"

  • Verify your Raylib installation path and pass it with RAYLIB_PATH=...

Game runs but graphics look wrong

  • Try updating your graphics drivers
  • Ensure you're using the correct Raylib version

Building Blocks

This project uses:

  • Raylib: Cross-platform graphics library (https://www.raylib.com/)
  • C++14: For modern C++ features
  • MinGW: GNU Compiler Collection for Windows

Enjoy the game! 🎮

About

My first game written in C++ using the raylib libraries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors