You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, sald leaves the game developer to worry about creating a main loop. Let's create some reusable code which:
manages a <canvas> tag; including resizing the tag based on demands from the game (e.g. aspect ratio, exact size, integer multiple-of-size)
handles timing and drawing, passing requests to a developer-defined (and changeable) object
grabs input, processes it to be properly canvas-relative, and passes the results to the (developer-defined) scene object
One way we might do this is have a window.scene variable, with (optional) functions draw(), update(elapsedSeconds), key(code, state), down(x,y), motion(x,y), and up(x,y).
The text was updated successfully, but these errors were encountered:
Currently, sald leaves the game developer to worry about creating a main loop. Let's create some reusable code which:
<canvas>
tag; including resizing the tag based on demands from the game (e.g. aspect ratio, exact size, integer multiple-of-size)One way we might do this is have a
window.scene
variable, with (optional) functionsdraw()
,update(elapsedSeconds)
,key(code, state)
,down(x,y)
,motion(x,y)
, andup(x,y)
.The text was updated successfully, but these errors were encountered: