Last active
June 6, 2018 02:38
-
-
Save gabrielflorit/bab65b680a9fcb5cc1f8325d285ec9d0 to your computer and use it in GitHub Desktop.
SCRIPT-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// title: Pulsing globe | |
initialState = { | |
o: 0 | |
} | |
update = s => { | |
s.o += 8 | |
} | |
draw = s => { | |
clear() | |
const st = 16 | |
const l = 256 | |
range(st).forEach(r => { | |
range(s.o, s.o + l, st).forEach((i, j) => { | |
const a = i * Math.PI / 180 | |
rectFill( | |
64 + (62 / st * r) * Math.cos(a), | |
64 + 62 * Math.sin(a), | |
1, 1, j + r) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment