Skip to content

Yet another Conway's Game of Life implementation but in a 3D space

Notifications You must be signed in to change notification settings

SyedAhkam/game-of-life-3d

Repository files navigation

Conway's Game of Life 3D

Yet another Conway's Game of Life implementation however the canvas is located in a 3D world so that you could fly around and observe cells changing their state in realtime.

Written in Rust using Bevy.

Sneak Peak

game-of-life-3d-demo-0001 game-of-life-3d-demo-0004

How to run

After installing Rust and fulfilling any system dependencies, you should be able to:

$ cargo run

Customisation

In main.rs there are a few constants which can be tweaked as it seems fit.

const TIME_STEP: u64 = 500; // in millis

const PLANE_SIZE: i32 = 48;
const CANVAS_SIZE: i32 = 32;
const CELL_SIZE: i32 = 4;
const CELL_GAP: i32 = 1;
const _CELLS_ON_CANVAS: i32 = (CANVAS_SIZE / CELL_SIZE).pow(2);

const CELL_ALIVE_COLOR: Color = Color::srgb(0.9, 0., 0.);
const CELL_DEAD_COLOR: Color = Color::srgb(0.9, 0.9, 0.9); // or use Color::NONE to make dead cells disappear
const PLANE_COLOR: Color = Color::srgb(0.3, 0.5, 0.3);

Controls

  1. Move camera around by using WASD for lateral movement.
  2. Use Left Shift and Spacebar for vertical movement.
  3. Use the mouse to look around.
  4. Press Esc to hide or show the mouse cursor.
  5. Press R to regenerate cells.

About

Yet another Conway's Game of Life implementation but in a 3D space

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published