Last active
March 28, 2018 14:14
-
-
Save nucleartide/85f96da1417e48365282ed385fe602e6 to your computer and use it in GitHub Desktop.
<canvas> game dev API sketches
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
// 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