Giter Club home page Giter Club logo

cpp-game-of-life-with-raylib's Introduction

CPP Game Of Life with raylib

This is a C++ implementation of Conway's Game of Life using raylib for graphics. The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It's a zero-player game, meaning its evolution is determined by its initial state, requiring no further input from human players. Players set up the initial configuration of cells on a grid, and then watch as generations evolve over time.

The project aims to provide an interactive experience, allowing users to visually explore the behavior of cellular automata through various patterns and configurations. Whether you're a seasoned programmer looking to experiment with raylib and cellular automata, or a beginner curious about the fascinating world of emergent complexity from simple rules, this tutorial offers something for everyone.

Features

  • Interactive Grid: Click to toggle cells between alive and dead states, crafting your initial setup or modifying it on the fly.
  • Control Simulation Flow: Easily start, pause, or reset your simulation with keyboard shortcuts.
  • Dynamic Speed Adjustment: Use keyboard inputs to speed up or slow down the evolution of the generations.
  • Random Initialization: Generate a random starting point to explore unexpected patterns and behaviors.
  • Infinite Grid: Thanks to edge wrapping, experience an unbounded canvas for your cellular automata, allowing patterns to move seamlessly across the grid boundaries.

Video Tutorial

๐ŸŽฅ Video Tutorial on YouTube



| ๐Ÿ“บ My YouTube Channel | ๐ŸŒ My Website |

How to Run the Program

Getting started with the Game of Life simulation is straightforward. After cloning the repository and setting up your environment as outlined in the README, you're ready to launch the program and engage with the interactive simulation. Here's your guide to controlling and interacting with the Game of Life:

  • Start the Simulation: Press Enter to initiate the simulation. Observe as the cells transition through generations, adhering to the Game of Life's rules.
  • Pause/Stop the Simulation: Hit the Spacebar to pause the simulation at any moment.
  • Create a Random Initial State: Tap R to populate the grid with a random mix of alive and dead cells, perfect for kicking off a new simulation with unforeseen developments.
  • Clear the Grid: Want a clean slate? Press C to clear the grid, turning all cells to a dead state.
  • Adjust Simulation Speed:
    • Increase the pace by pressing F, making the generations evolve quicker.
    • Slow things down with S, giving you a closer look at each generation's transformation.
  • Toggle Cell States with Mouse Click: Click on any cell within the grid to toggle its state. Bringing an alive cell to death or reviving a dead cell allows you to manually craft or alter patterns and see how they unfold.

With these controls at your disposal, you have complete mastery over the simulation, offering a sandbox to explore the depth of the Game of Life from your perspective. Try out various initial setups, speeds, and patterns to uncover the endless possibilities hidden within this simple, yet profound simulation. Dive into the captivating world of cellular automata and enjoy the exploration!

cpp-game-of-life-with-raylib's People

Contributors

educ8s avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

liudenaxietian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.