Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 2.38 KB

README.md

File metadata and controls

49 lines (43 loc) · 2.38 KB

Game of life

Conway's game of life made in C using sdl2.

Forks Stars

Note
This project is old and the code sucks. I am going to improve it in the future.
If you are interested in other projects I made with better code, check this.

Table of contents

  1. Keys
  2. Configuration
  3. Misc
  4. TODO

Keys

Key Action
Esc Exit.
LMouse Change the cell's state individually.
RMouse Change the cell's state (drag).
Space Hold to start the game of life simulation.
H Show help in console.
G Togge grid.
S Save current state.
L Load saved state.
C Clear (Set state of all cells to 0).
R Random state.

Configuration

Name Description
WINDOW_H Window height in pixels.
WINDOW_W Window width in pixels.
CELL_SIZE Cell size in pixels.
BACKGROUND_COLOR Will be used as RGB value for the background.
For example 34 = RGB(34, 34, 34) = #222222.
CELL_COLOR Will be used as RGB value for the living cells.
GRID_COLOR Will be used as RGB value for the grid.
FPS In ms. The program will wait 1000/FPS (1000 / 60 = 16ms between frames).
DELAY If the space is pressed the delay between frames will be switched to this.
(Instead of 16ms for example).
DEBUG_PRINT If 0, the program will print information about keypresses and cell interactions.

Misc

TODO

  • Make saves independent on the array size (resolution)