Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Last active March 22, 2019 23:43
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/dd316e72dc38fc5d0657dacab5575c9a to your computer and use it in GitHub Desktop.
Save gabrielflorit/dd316e72dc38fc5d0657dacab5575c9a to your computer and use it in GitHub Desktop.
SCRIPT-8
init = state => {
state.x = 60
state.y = 60
}
update = (state, input) => {
state.x = input.left ? state.x - 1 : input.right ? state.x + 1 : state.x
state.y = input.up ? state.y - 1 : input.down ? state.y + 1 : state.y
}
draw = state => {
clear(6)
rectFill(state.x, state.y, 8, 8, 0)
}
{
"iframeVersion": "0.1.247",
"lines": [
15,
0,
0,
0,
0,
0,
0,
0
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment