This was fairly straightforward. I added a bunch of quality of life features for the simulation.
-
Clearing the screen (c) fills the board with the same 2-dimensional array filled with
Falseas the default board. -
Speed up (+) and down (-) set the FPS up or down 1 and then it is passed into
clock.tick()at the end of the main while loop.- Speed presets (1-9) set the FPS to the corresponding index of an array of settings. As of right now, it’s just a sequence of powers of 2 from 1 to 256, but I might change it to something more ergonomic. I like this one because I use one if statement to handle all 9 keys.
-
Pausing (space) as promised earlier. This just toggles a variable that is
Falseby default, and then I am checking if it’sTruelater.
Next I am going to add a small menu that will display important information like the number of the generation, as well as the presets. I want it to be hideable so as to not block it, but I also want the board to be the whole screen, so it’s going to be a small window. Then, maybe, tapping into the flexibility of my custom draw() function and adding preset colorschemes?
P.S.: Here is a better recording that showcases the simulation… The last post didn’t do it very much justice…
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.