Skip to content

Instantly share code, notes, and snippets.

@icarito
Last active May 11, 2019 04:24
Show Gist options
  • Save icarito/2584134b10497e3139e3f5b4bb81f7ea to your computer and use it in GitHub Desktop.
Save icarito/2584134b10497e3139e3f5b4bb81f7ea to your computer and use it in GitHub Desktop.
SCRIPT-8
// title: Lava Effect #1
initialState = {
t: 0
}
update = (state)=> {
state.t += 1
}
draw = (state)=> {
clear(5)
line(0, 103, 127, 103, 1)
let ola = Math.floor(state.t / 30)
for (let x in range(8)) {
sprite(x*16, 96, ola % 3)
sprite(x*16+8, 96, 2 - (ola % 3))
}
rectFill(0, 104, 127, 127, 1)
}
{
"iframeVersion": "0.1.247",
"lines": [
20,
0,
0,
0,
0,
0,
0,
0
]
}
{
"0": [
" ",
" ",
" ",
" ",
" ",
" ",
" 00 ",
" 0000 "
],
"1": [
" ",
" ",
" ",
" ",
" ",
" 11 ",
" 1 1 ",
" 1 1 "
],
"2": [
" ",
" ",
" ",
" ",
" 00 ",
" 1001 ",
" 1 1 ",
"1 1"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment