Skip to content

SamarthPyati/cellular-automata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cellular Automata in Raylib (C)

I implemented Conway's Game of Life and Brain`s Brain using Raylib.

Requirements

  • Raylib: A C library for simple 2D game development.

Feature

  • Conway's Game of Life implementation
  • Brian's Brain implementation
  • Camera controls (pan and zoom)
  • Grid randomization and clearing
  • Ability to switch between rule sets

Installation

  1. Clone the repository:

    git clone https://github.com/SamarthPyati/game-of-life.git
    cd game-of-life
  2. Install Raylib: Follow the installation instructions on the Raylib website.

  3. Compile the Code:

    • You can compile the project using a C compiler. If you're using GCC on Windows, use the following command:
    gcc -o gol gol.c -lraylib -lgdi32 -lopengl32 -lm
    • On linux / mac operating systems:
    gcc $(pkg-config --libs --cflags raylib) -lm -o gol gol.c 

Usage

  1. Run the Program:

    • Build the program.
    • Execute the compiled binary:
      ./gol
  2. Controls:

    Key Combination Action
    Arrow Keys Move the camera
    Mouse Wheel Zoom in and out
    Left Mouse Button Toggle cells
    SPACE Pause/Unpause the simulation
    R Randomize the grid
    C Clear the grid
    Z Reset camera position and rotation
    Left Shift + Z Reset camera position, rotation, and zoom
    B Switch the Rules
    M Toggle Music
    Esc Quit the program

Upcoming Features

  • Save Game state in files
  • Colorful gradients to hallucinate
  • More user friendly UI

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A cellular automata simulation of popular 'Game Of Life' and 'Brian`s brain' written in C using Raylib.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published