You are browsing as a guest. Sign up (or log in) to start making projects!

PythonLife

  • 5 Devlogs
  • 3 Total hours

Conway's game "Life" on Python.

Ship #1

I made PythonLife — an interactive, fully responsive Conway's Game of Life simulation built with Pygame and NumPy.

The biggest challenge was optimization. Standard nested loops lag heavily on large screens, so I completely rewrote the update logic using NumPy matrix shifts with `np.roll()`. This counts all neighbors simultaneously and applies rules instantly via array masking, keeping the FPS smooth even in borderless fullscreen mode. Another unexpected challenge was configuring the Web/Executable build environment, but I successfully compiled everything into a standalone executable.

I’m really proud of the performance and the seamless window scaling feature—the simulation auto-extends on the fly, introducing random noise into newly opened space while preserving existing patterns.

To test the project, click "Try project" to download the pre-compiled `PythonLife.exe` from my GitHub Releases, open it, and you're good to go! Left-click to draw living cells, right-click to clear them, press Space to pause, and use keys 1, 2, or 3 to change simulation speed.

  • 5 devlogs
  • 3h
Try project → See source code →
Open comments for this post

28m 49s logged

The first version is officially ready! For the first time ever, I’ve created my own GitHub release and bundled the entire game into a 25MB .exe file.

Also upgrade README.

Shipping it in a bit! <3

0
0
5
Open comments for this post

56m 57s logged

Spent the last hour trying to port the project to web with pygbag, but no luck so far <3

On the bright side, I added time controls: you can now speed things up by 2x or 4x using numbers keys.

Also, moved everything to a config.py file, so you can easily tweak colors, base FPS, keybindings, and more.

Also fix some F11 bugs.

0
0
3
Open comments for this post

41m 38s logged

Finally, fully interactive drawing is now live.
You can left-click to spawn cells and right-click to wipe them out on the fly.

Added a proper pause state on Spacebar too, so you can stop time, comfortably sketch out gliders, spaceships, or any complex structures, and then let them loose.

Also made the window fully resizable, which means you can just hit the square icon to maximize it, or press F11 for a true borderless fullscreen. Had a bit of a nightmare with Windows loop-crashing the resolution scaling at first, but it is completely fixed now.

The grid dynamically auto-adjusts to whatever screen size you throw at it, keeping your current shapes intact while filling the new empty space with random chaos.

0
0
4
Open comments for this post

18m 16s logged

I just added a basic PyGame simulation and it looks cool!

With constants, I can easily change the grid size and colors.

Now I want to add the ability to pause the game and draw figures with a mouse click!

0
0
3
Open comments for this post

33m 33s logged

I decided to start this project to master NumPy, a useful library for matrix operations in Python.

I’m planning to use PyGame to visualize the game grid.

Also, the game board features wrapped boundaries, meaning cells seamlessly teleport to the opposite side when crossing the edges!

0
0
20

Followers

Loading…