Built by 0xGhost <3 👻

C++ · Qt Framework · Desktop Port

FIREBOY &
WATERGIRL

Forest Temple Edition — Cooperative Puzzle Platformer

GitHub Game Flow Explore Features Controls
Screenshots
Gameplay screenshot 1
Gameplay screenshot 2

Built from
scratch

Every mechanic hand-coded in C++ using custom data structures — no game engine shortcuts.

01
4 Unique Levels

Forest, cave, and ruins biomes. Each level built from a Binary Search Tree tilemap with gates, buttons, hazards, conveyor belts and teleport pads.

02
Cooperative Puzzles

Control both players simultaneously. Stand on pressure plates to open gates for your partner. Both must reach their door to advance.

03
Undo / Redo

State snapshots taken every 500ms. Press U/R to rewind mistakes. Powered by a doubly-linked state history — the whole game is undoable.

04
Dijkstra Hint System

Press H for a live pathfinding overlay. Dijkstra's algorithm computes the optimal gem-collection route for each character in real time.

05
Leaderboard

Scores persisted to disk, QuickSort-ranked, binary-searched for player rank. Survives between sessions and rewards fast completions.

06
60 fps Game Loop

Qt QTimer ticks every 16ms. Physics, collision detection, event priority queue, gate logic and rendering all complete within a single frame budget.

Data
Structures
& Algorithms

Every data structure was implemented from scratch in src/DSA.cpp — no STL containers, no shortcuts. Eleven classic structures, each mapped to a real game mechanic.

01
Doubly Linked List
Level catalogue + undo/redo history
O(1) insert
02
Priority Queue (Min-Heap)
Event pipeline — death > win > gem
O(log n)
03
Hash Map (Direct Address)
Button→gate + teleport lookups
O(1)
04
BST Tile Map
Sparse tilemap storage per level
O(log n)
05
Conveyor Queue
Players pushed on belt tiles
FIFO
06
Singly Linked List
Gem collection trail (win screen)
O(1) append
07
Dijkstra's Algorithm
Hint path through gems → door
O((V+E) log V)
08
QuickSort
Leaderboard score ranking
O(n log n)
09
Binary Search
Player rank lookup in scoreboard
O(log n)
10
Linear Search
Gem proximity detection
O(n)
11
Min-Heap Gem Finder
Nearest reachable gem per player
O(n log n)
Controls
Fireboy
Move left
Move right
Jump

Safe in lava. Dies in water and poison.

Watergirl
AMove left
DMove right
WJump

Safe in water. Dies in lava and poison.

Special Keys
HToggle hint path
UUndo (rewind 500ms)
RRedo / Restart
EscPause / Resume
NNext level
PPrevious level
Ctrl+LLives ++
Built with
C++17 Qt 5/6 QTimer · 60fps game loop QSoundEffect QMediaPlayer QPainter QStackedWidget Custom DSA — no STL containers QSS Stylesheet 16×20 tile grid · 40px tiles

Complete execution path — from main.cpp through the 60fps game loop to every possible outcome.

Game Architecture Flowchart
Download Technical Diagram