Skip to content

Instantly share code, notes, and snippets.

@nucleartide
Last active March 28, 2018 14:14
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 nucleartide/85f96da1417e48365282ed385fe602e6 to your computer and use it in GitHub Desktop.
Save nucleartide/85f96da1417e48365282ed385fe602e6 to your computer and use it in GitHub Desktop.
<canvas> game dev API sketches
// Imperative, immediate-mode API. (Inspired by PICO-8.)
function _init() {
}
function _update() {
}
function _draw() {
cls(Color.Blue);
rectfill(20, 30, 30, 30);
}
// Declarative, retained-mode API.
<Canvas clear={Color.Blue}>
<Rect x={20} y={30} w={30} h={30} />
</Canvas>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment