Skip to content

Doreen1113/LifeGrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LifeGrid

A puzzle game that merges Conway's Game of Life with player navigation. You control a character on a living grid — cells evolve every tick, and touching a live cell costs you HP. Navigate, collect coins, and survive long enough to complete each level.

Built with C++ and Allegro 5.


Gameplay

The grid evolves according to Conway's Game of Life rules each frame. Your character (green square) must reach objectives without stepping on live cells.

  • Touching a live cell → -1 HP, respawn at (0, 0)
  • Running out of HP or time → Game Over
  • Coins are scattered around the map — collect them to spend in the shop

Shop (available during levels)

Key Action Cost
Freeze the grid for 5 seconds 200 coins
+1 HP (max 4) 300 coins

Levels

Level 1 — Pathfinding

Navigate from the top-left corner to the target cell at the bottom-right. Static obstacles block the path.

Level 2 — Target Collection

Step on 10 randomly placed gray tiles within 60 seconds.

Level 3 — Block Breaker

Break 4 numbered blocks (each has 3 HP) located in the four quadrants of the map. Each time you step on a block it takes damage. Breaking a block triggers a screen shake and teleports your character to a safe position.


Controls

Start Screen

Key Action
Enter Start game (Level 1)
Space View tutorial (INFO screen)

In Game

Key Action
W A S D Move character
Buy Freeze (200 coins)
Buy +1 HP (300 coins)
P Pause / Resume
Esc Quit

Tutorial Screen (INFO)

Key Action
/ Cycle demo patterns
15 Jump to a specific pattern
Enter Return to previous screen

Create Mode (unlocked after beating the game)

Key Action
W A S D Move cursor
Space Toggle cell / Start or pause simulation
Enter Confirm

Build & Run

Requirements

  • Allegro 5
  • MinGW (GCC for Windows) or compatible C++ compiler

Build

make

Run

./game.exe

Make sure allegro_monolith-5.2.dll and the assets/ folder are in the same directory as the executable.


Project Structure

SourceCode/
├── Main.cpp               # Entry point
├── Game.cpp / .h          # Game loop and state machine
├── Level.cpp / .h         # Level loading and layout
├── GameOfLifeGrid.cpp / .h# Conway's Game of Life logic
├── PlayerCharacter.cpp / .h  # Player movement and collision
├── Player.h               # HP and coin data
├── UI.cpp / .h            # HUD rendering
├── data/                  # DataCenter, SoundCenter, ImageCenter, FontCenter
├── shapes/                # Point, Rectangle helpers
├── assets/
│   ├── patterns/          # Level map text files
│   ├── image/             # Sprites and icons
│   ├── font/              # TTF fonts
│   └── sound/             # Sound effects and music
└── makefile

Resources

About

Conway's Game of Life × C++ puzzle game with 3 levels, coin economy, and sandbox mode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors