A Donkey Kong-inspired platformer written in C with raylib.
You play as a heroic banana on a single-screen climbing challenge. Kong, the big ape on the top platform, paces back and forth and hurls barrels your way. They roll across platforms, bounce off walls and screen edges, crash down ladders, and every so often one sails over your head in a high arc and lands a floor or two below. Your goal is simple: dodge the barrels, scale the wooden platforms, and reach the golden flag at the very top.
Each climb tests your timing as much as your reflexes - barrels never stop coming, so every pause means another one is rolling your way. Get hit and you lose a life; run out of three lives and it is game over. Each hit respawns you on the opposite side of the stage. Score points by surviving barrels, by stomping them from above (bounce off their tops for +50), and by winning the climb.
Rendering and sound use free pixel-art sprites and effects from the Kenney "New Platformer" pack (CC0 license).
- Grid-based Donkey Kong-style level: platforms, ladders, and a goal flag.
- A patrolling Kong boss that throws barrels, alternating direction and lobbing high arcs that clear a floor or two.
- Banana hero with smooth movement, jumping, and ladder climbing.
- Rolling barrels that fall off edges, crash down ladders, bounce off walls and screen edges, and hop when they reverse or land a step down.
- Stomp barrels from above to smash them (+50) and bounce back up.
- Two spawn points; each hit respawns you on the opposite side.
- Three lives, scoring, and a blinking invulnerability window after hits.
- Title, game-over, and win screens with one-key restart.
- Pause with
P, score popups, a score-based difficulty ramp, and a persistent best score. - Pure-logic modules (
physics,level) with unit tests. - Sprite rendering and sound effects from the Kenney New Platformer pack.
- Runs at 60 FPS with a fixed-size 640x480 window.
| Title screen | Gameplay | Climbing the ladder |
|---|---|---|
![]() |
![]() |
![]() |
sudo dnf install raylib-devel cmake gcc makesudo apt install libraylib-dev cmake gcc makebrew install raylib cmakeInstall CMake and a compiler such as MSYS2/MinGW-w64, then install raylib via MSYS2:
pacman -S mingw-w64-x86_64-raylibOr build raylib from source and point CMake at it.
cmake -B build
cmake --build build
./build/bananakongThe CMake setup finds raylib automatically via its config file, pkg-config, or a manual library lookup, so it works across all three platforms above.
ctest --test-dir build --output-on-failureUnit tests cover the physics helpers (including stomp detection), level tile queries and connectivity, the difficulty ramp, score popups, and high-score persistence (147 checks).
| Action | Keys |
|---|---|
| Move | Arrow keys / WASD |
| Jump | Space |
| Climb | Up / Down on a ladder |
| Pause | P |
| Start / restart | Enter |
src/
├── main.c entry point and game loop
├── config/constants.h shared tuning constants
├── core/ game state, rendering, physics helpers
├── entities/ player and barrel logic + drawing
└── world/ level grid and collision queries
assets/ Kenney sprites and sound effects (CC0)
tests/ unit tests (physics, level, difficulty, popup, highscore)
- CONSTRAINTS.md - coding rules
- CONTRIBUTING.md - git workflow
- CHANGELOG.md - release history
- raylib.com - home page and news
- raylib cheatsheet (HTML)
- raylib cheatsheet (PDF)
- raylib examples
- raylib.h reference
- raylib wiki
- Coding conventions, architecture, CMake build system, and FAQ
Sprites and sound effects come from the Kenney "New Platformer" pack
(CC0), courtesy of
Kenney. The license file is bundled at
assets/LICENSE-Kenney.txt.
MIT. See LICENSE.



