Last active
November 27, 2017 11:05
-
-
Save HelveticaScenario/97bdcf320606a2736fcede46c3f0ca20 to your computer and use it in GitHub Desktop.
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
let lastMouse ={ | |
x: -1, | |
y: -1 | |
} | |
function _init() { | |
cls() | |
} | |
function _draw(time) { | |
const [x, y] = mouse() | |
if (x === -1 || y === -1) { | |
lastMouse.x = -1 | |
lastMouse.y = -1 | |
return | |
} | |
if (lastMouse.x === -1 || lastMouse.y === -1) { | |
lastMouse.x = x | |
lastMouse.y = y | |
} | |
line(x, y, lastMouse.x, lastMouse.y) | |
lastMouse.x = x | |
lastMouse.y = y | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment