Skip to content

justinasr/GameOfLifeSDL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game of Life SDL

Conway's Game of Life using SDL2

Game demo

Description:

This is an implementation of Conway's Game of Life using SDL2 libarary for graphics and user input.

In this implementation, world wraps around, that is, cell to the left of leftmost cell is the rightmost cell, right of the rightmost is the leftmost one. World wraps around both horizontally and vertically.

In order to prevent stable state, random cells are made alive every 512 generations ("aliens").

Dead cells are black, alive cells are green. When alive cell dies, it slowly fades from gray to black. If alive cells lives for 16 generations, it becomes "old" and changes color to blue. Aliens are red during the generation that they are injected.

Controls:

  • arrow up - increase game speed
  • arrow down - decrease game speed
  • space - toggle pause/play
  • a - inject aliens
  • c - clear the world
  • n - go to next generation
  • q - quit
  • + or = - increase cell size
  • - - decrease cell size
  • left mouse click to toggle cell

Dedicated to 40/3-A19 and everyone who was there ❤️

About

Conway's Game of Life with SDL2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors