lukejac13 / GameOfLife

2 stars 0 forks source link

Added Simulation Rules #6

Closed lukejac13 closed 8 months ago

lukejac13 commented 8 months ago

The simulation works now, and the basic rules of Life were employed successfully, where it updates on a set interval, or by pressing the forward button to increment one frame at a time.

We need to be able to change the speed of the simulation, so we need to edit the "speedUp()" and "speedDown()" function in game.js to be able to change the speed at which it updates, to be faster or slower. this is done by changing the 'Speed' variable. I suggest setting a maximum and minimum speed, such as 1ms - 1000ms (1 second) or something, and increment by 10-100ms each time you click the up/down button

Remember, the larger the speed value 'speed = 10000', the slower the simulation will run, since 'speed' is the time it sleeps between updates. so the longer the time it sleeps, the slower it will update

Also create tests in test.js using QUnit to make sure values are being updated correctly or for any other features you add

robertutterback commented 8 months ago

Closes #1

robertutterback commented 8 months ago

If you have to have a special note about a variable (speed), that's a good sign it's not a good variable. Maybe call the variable sleepTime or something.