This is a multithreaded graphical game inspired by Fireboy & Watergirl, developed in C using GTK for GUI and POSIX Threads for multithreading. Players control Fireboy and Watergirl simultaneously to navigate levels, collect gems, avoid hazards, and reach their respective exits. Cooperation is key to completing levels!
- 🔄 Multithreaded player controls for smooth simultaneous movement of Fireboy and Watergirl.
⚠️ Dynamic hazards (e.g., moving obstacles) controlled by independent threads.- ⭐ Collectibles — gather gems before reaching the exits.
- 🧩 Randomized map generation — each level has unique layouts with obstacles, exits, and collectibles.
- ⏳ Progress bars — track gem collection and proximity to exits.
- ❤️ Lives system — lose lives upon mistakes; game ends when lives hit zero.
- ✅ Level completion detection — advance through progressively harder levels.
project_root/
├── fireboy_watergirl.c // Main source file
├── assets/
│ ├── FireBoy.png
│ ├── WaterGirl.png
│ ├── lava.png
│ ├── water.png
│ ├── ground.png
│ ├── fireexit.png
│ ├── waterexit.png
│ ├── firegem.png
│ ├── watergem.png
│ ├── fence.png
│ ├── hazard.png
│ └── barrier.png
└── README.md
- Operating System: Linux or any system supporting GTK.
- Dependencies:
- GTK 3 or higher.
- POSIX Threads (pthreads).
- Compiler: GCC.
- Open a terminal in the project directory.
- Compile the game using:
gcc fireboy_watergirl.c -o fireboy_watergirl `pkg-config --cflags --libs gtk+-3.0` -lpthread -lm - Run the game:
./fireboy_watergirl
Ensure that all required image files (e.g., FireBoy.png, WaterGirl.png, etc.) are located in the assets directory.
| Player | Action | Key |
|---|---|---|
| Fireboy | Move Up | W |
| Fireboy | Move Down | S |
| Fireboy | Move Left | A |
| Fireboy | Move Right | D |
| Watergirl | Move Up | Up Arrow (↑) |
| Watergirl | Move Down | Down Arrow (↓) |
| Watergirl | Move Left | Left Arrow (←) |
| Watergirl | Move Right | Right Arrow (→) |
- Players must navigate to their respective exits (Fireboy → Fire Exit; Watergirl → Water Exit).
- Collect all gems before heading to the exits.
- Avoid hazards:
- Fireboy cannot touch water tiles or moving hazards.
- Watergirl cannot touch lava tiles or moving hazards.
- Players share a pool of lives (3 per player). Losing all lives results in a game over.
- Complete all levels to win the game!
- Start the game by running the executable (
./fireboy_watergirl). - Use the controls to move Fireboy and Watergirl simultaneously.
- Navigate through randomized maps featuring:
- Lava and water tiles as obstacles.
- Gems as collectibles.
- Pressure plates to deactivate barriers (in advanced levels).
- Progress bars at the bottom of the screen show:
- Gem collection progress.
- Proximity to exits.
- Complete all levels (5 total) to win!
- Coordinate movements between Fireboy and Watergirl carefully!
- Keep an eye on hazards — they move dynamically!
- Collect all gems before heading to exits; skipping gems prevents level completion.
- C Language
- GTK Library for graphical rendering.
- POSIX Threads for multithreading.
Enjoy playing! 🎮