Fourth Devlog
I’ve received so many helpful comments from my first ship so I’ll make sure to fix all the problems people have had while testing my project….but, before fixing it I thought maybe I could first break it a little more. d=(´▽`)=b
This time I’ve changed the core logic of counting neighbors and in it introduced a way to change how borders are handled.
At first the borders were always counted as dead cells, causing all life to die or stagnate when it hits an edge (as the gliders do in the right -> attachment) and so I wanted to make a way to switch the borders so that they wrap around to the opposite end of the map to make it possible for some cool effects (such as the gliders shown in the left <- attachment).
Progress:
Added:
A button for toggling Borderless mode on or off:
When toggled on, this button will cause the border cells to become neighbors and basically wrap the whole grid so that the processes are not bound by the edges of the grid, but can be carried out infinitely
Changed:
For the implementation of the borderless mechanic I wanted to first prep my main neighbor-counting logic so I rewrote it.
Before, it was using 9 if statements to manually check and count the alive neighbors, but now I’ve automated that process with 2 for loops and some additional checks - making my code much more readable and better for any future changes as it’s more modular
Attachments:
A side-by-side comparison of how the game behaves if you toggle the borderless mode on vs off. There are many kinds of shapes docummented throughout the time people have been playing around with Conway’s Game of Life.
In the gifs you’ll see a very simple glider that will move indefinitely if undisturbed. I’ve used them to showcase the way the borders change the game logic.
Log in to leave a comment