p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Improving Conway's Game of Life Example

Open crh82 opened this issue 3 years ago • 1 comments

Most appropriate sections of the p5.js website?

Examples

What is your operating system?

Mac OS

Web browser and version

Safari 16.0

Actual Behavior

Noting that there is no Existing Feature Enhancement option for contributing here this may not be the correct issue to raise. In which case please let me know, and I will submit the issue more appropriately. I am new to contributing to open-source projects.

Currently, in the game of life example, the states transition too quickly. This causes an unpleasant flickering effect to occur, which could upset photosensitive individuals.

Expected Behavior

In the original example from the Processing website the game of life has an interval between state updates:

int interval = 100;
int lastRecordedTime = 0;

...

void draw() {

  //Draw grid
  ...
  // Iterate if timer ticks
  if (millis()-lastRecordedTime>interval) {
    if (!pause) {
      iteration();
      lastRecordedTime = millis();
    }
  }

This makes the example considerably more pleasant to watch.

Steps to reproduce

Just simply view the example on the website.

Would you like to work on the issue?

Yes

crh82 avatar Oct 11 '22 22:10 crh82

You can go ahead with a fix. Thanks.

limzykenneth avatar Oct 13 '22 13:10 limzykenneth

No worries, I'll get cracking on it.

crh82 avatar Oct 18 '22 21:10 crh82