This was a side project to my entry for the Junk Drawer Contest. I was working on an Infineon XMC4200 Platform2Go board and an Adafruit touch screen and I was stuck on getting all parts working, so I started testing the speed of the graphics. Soon I forgot my actual project and made this instead.
Conway's Game of LifeHere you can read more about it.
In short, it's a simple set of rules how cells in a grid get born, live and die.
My setupThe TFT shield fits on an Arduino Uno or Leonardo or similar. I started working with a Leonardo. The focus was on a quite different project, but the memory of the Leonardo turned out to be too small. So I switched to this Infineon board. Then I ran into other issues and started to work on this side project. I never switched back to Leonardo, but I guess this tiny program could fit just any Arduino or clone with the Uno form factor.
The screen has 320*240 pixels. I thought it would work with 10*10 pixel cells, so I have a grid of 32*24 cell spots.
The game starts with a blank screen. You draw cells on the blank screen. Each touched spot becomes a cell. As soon as you lose touch of the screen, the next generation starts. But you can at any time continue drawing cells onto the ongoing chaos. The generating pauses while you are drawing.
The space wraps around the edges. If you manage to create a glider, it will run off the edge and appear on the opposite side.
Well, that's all there is to it, folks. Hope you like it. Hope you can improve it.










Comments