Giter Club home page Giter Club logo

conway-s-game-of-life-in-lua-and-love2d's Introduction

Conway's Game of Life in Lua and Love2D

Conway's Game of Life is a cellular automaton simulation developed by mathematician John Conway. The game follows simple rules to simulate the evolution of a population of cells on a two-dimensional grid. The cells can be in one of two states: alive or dead. The game evolves based on these rules:

  1. Any live cell with fewer than two live neighbors dies, as if caused by underpopulation.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by overpopulation.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

Getting Started

To run the Conway's Game of Life simulation, you will need the Love2D framework installed on your system. Love2D is a framework for creating 2D games and interactive applications. You can download Love2D from the official website: https://love2d.org

Once you have Love2D installed, follow these steps to run the simulation:

  1. Clone this repository or download the code as a ZIP file.
  2. Extract the contents of the ZIP file (if applicable).
  3. Navigate to the project directory using the terminal or file explorer.
  4. Run the game by dragging the project folder onto the Love2D executable or use the command love . in the terminal.

Controls

Press 'r' to reset the simulation and generate a new random initial configuration for the cells.

Customization

You can customize the simulation by modifying the following variables in the main.lua file:

cellSize: Adjust the size of each cell in pixels to change the level of detail and appearance of the simulation.

gridWidth, gridHeight: Change the dimensions of the grid to control the number of cells in the simulation.

grid[x][y]: Modify the initializeGrid() function to set specific patterns or initial configurations for the cells.

License

This project is licensed under the MIT License.

Acknowledgments

John Conway for creating the Game of Life.

Love2D developers for the Love2D framework.

Screenshots

Alt text

conway-s-game-of-life-in-lua-and-love2d's People

Contributors

aethelios avatar

Watchers

 avatar

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.