Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Last active June 6, 2018 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielflorit/bab65b680a9fcb5cc1f8325d285ec9d0 to your computer and use it in GitHub Desktop.
Save gabrielflorit/bab65b680a9fcb5cc1f8325d285ec9d0 to your computer and use it in GitHub Desktop.
SCRIPT-8
// 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