packagemain.tech

packagemain.tech

Building Conway’s Game of Life in Go with raylib-go

A step-by-step tutorial on building Conway’s Game of Life in Go, using raylib-go for graphics. Learn how to draw grids, apply the rules of life, and simulate evolving patterns.

Tim Little's avatar
Tim Little
Sep 22, 2025
∙ Paid

I recently started to play around with graphics programming and game engine creation. For that, I was using SDL2, OpenGL and C.

However, I wanted to do something in Go, so I started with Conway’s Game of Life. There are various options from C bindings to OpenGL and SDL2 to full game engines such as Ebitengine. I went with raylib-go as it was a good mixture of low-level and abstracted programming.

In this tutorial, we’ll use Go and raylib-go to create Conway’s Game of Life, a simulation where simple rules create endless patterns. By the end, you’ll have gliders drifting, pulsars pulsing, and even a glider gun firing across your screen.

The Game of Life

Conway’s Game of Life is a cellular automaton created by John Conway. It is a zero-player game which evolves. Each generation is built on the previous generation using a set of simple rules.

The game requires no players as you start it off, and it starts to evolve without intervention. It is Turing Complete and can simulate a wide variety of different patterns and Turing Machines.

It starts with an initial game start, then it uses the following rules to determine which cell lives or dies:

  1. Any live cell with fewer than 2 live neighbours dies, as if by underpopulation.

  2. Any live cell with 2 or 3 live neighbours lives on to the next generation.

  3. Any live cell with more than 3 live neighbours dies, as if by overpopulation.

  4. Any dead cell with exactly 3 live neighbours becomes a live cell, as if by reproduction.

Each generation or frame in the context of our game will use these rules to determine the next state.

Demo

In this tutorial, we will be creating a simple cellular automation in Go using raylib-go. It will start with a state we define, and allow us to modify the state to see different evolutions.

Game of life

User's avatar

Continue reading this post for free, courtesy of Alex Pliutau.

Or purchase a paid subscription.
Tim Little's avatar
A guest post by
Tim Little
Follow me on: - Medium: https://medium.com/@tim_little - LinkedIn: https://www.linkedin.com/in/timjlittle/
Subscribe to Tim
© 2026 Aliaksandr Pliutau · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture