u(t) is called 60 times per second.
t: Elapsed time in seconds.
S: Shorthand for Math.sin.
C: Shorthand for Math.cos.
T: Shorthand for Math.tan.
R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5)
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
To get neighbor cells I do the div/mod trick on the 'index' but need to exclude (0,0) which has index 4. So I map cell index to i%8+5 which %9 is [5,6,7,8,0,1,2,3]
I cheat a little. Y=i>>10 so my rect should use (i>>10)*8 but to save chars I use i>>7. The cells are slightly off-place vertically but its hard to notice.
u(t) is called 60 times per second.
t: elapsed time in seconds.
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
S: Math.sin
C: Math.cos
T: Math.tan
R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)