Holidays are over and works getting back in the swing so I wanted to post my updates before things get crazy.
I hope everyone had fun over the holidays.
So new version. Took a lot of the feedback you fine people gave and made I think some significant improvements including some new features.
Not sure why it was happening but some people's browsers were catching key strokes before the game launched with the green flag causing an error. I've put in a running check and that seems to have fixed the bug. Also added in a QoL where the board boarder turns RED to indicate Paused and back to GREEN for unpaused
Sorry for the trouble everyone who tried to run it
First to the kudos because none of us would be as good as we are without the criticisms and feed back of others in our field
@qw23 - Your help with generalizing my idea of taking a snap shot of certain settings was AWESOME. I didn't take it ALL the way because I still wanted to keep this library free. Still THANK YOU!
@mobility212 - Thank you SO much for inspiring me to rethink my approach by pointing out the game really was not playing like it should.
Apparently I cannot quote more than 2 per post so the rest of you will be in a comment sorry about that.
Thank you all for the help learning how to harness this fun quirky little language
The Changes:
This was Version 1.0
This is Version 2.0
The first major change was moving all but the enter key stepping check into a single key press switchboard command block
Second was changing the entire mechanics of how each turn of the game is evaluated
instead of
where each clone would independently note its neighbors then spend eternity living or dying by the changes to its neighbors
Here we
record the board ONCE with
By recoding a record of the clone itself, a boolean flag, and its neighbors based on proximity into a single list later in the game loop
run game can just evaluate the cells list as a whole and update all cells in a single turn
First it uses
in a nutshell this evaluates ALL cells setting a flag (from its record in the cells list) for each if their state should be toggled
Then
maps a list of JUST the clone objects by first keeping ONLY the records with a toggle flag set
finally it tells each cell to in that filtered list to get its next costume
and turn over
Because in memory filtering and mapping of a list is ALWAYS faster after it is created than rebuilding the list every time the game runs significantly faster and more reliable. Also fixes the issue where cells were not updating together in a turn
The next thing
To test and validate the game mechanics were working I added a series of Templates for different game "pieces" things like Still Life which never change, or Oscillators that cycle between 2 or more states forever, or Spaceships that move across the screen in a repeatable manner
I recoded snap shots of gameboards with each template in the center and turned them into a series of costumes for a template sprite
It simply cycles through the templates in a category displaying the selected template above the board for the user
then if the board is clicked
If we have a selected template it calls
which reads in the layout data of the template which for an example is just a 2 dimensional array with the indexes of the alive or dead costumes (This one is the template shown above)
they are all grouped in their own categories like
Where each is paired with its costume index
Finally the game has the templated applied and control reverts to clicking toggling a single cell (this is a snap shot as the template is cycling)
Version 3.0?
Work is gearing up in full swing so it will probably be a while before I can really dig into this like last 2 weeks.
Some things I had hoped to figure out but just couldn't right now.
One big one is allowing the Templates to be stamped on the board at whatever cell the mouse cursor clicks on instead of defaulting the the center of the game board.
Also would love to figure out why the game throws the error it does when the stop button is pressed.
Closing
Thanks again for everyone's feedback on version 1.0. Looking forward to hearing more from everyone.