Fundamental
Fundamental Functions
makeGraphicsWindow
makeGraphicsWindow
Creates a new graphics window.
width
*
number
-
the desired width of the animation window, in pixels
height
*
number
-
the desired height of the animation window, in pixels
canvasDomNode
*
object
-
the DOM node for the html canvas element
Returns
nothing
Note: You will always need to call this function as the first thing you do in order to make your graphics window
runGraphics
runGraphics
Starts the animation or game running.
startFunction
*
function
-
the name of the function that initializes your new world. Takes one argument (the world)
updateFunction
*
function
-
the name of the function that updates your world for the next frame. Takes one argument (the world)
drawFunction
*
number
-
the name of the function that draws the frames of your animation. Takes one argument (the world)
Returns
nothing
Note: Your should call this function on the very last line of your program
endGraphics
endGraphics
Stops the animation from running.
Returns
nothing
Note: You may want your animation to end at some point. The user can always end your program by closing the window/tab. To have your program make the animation stop, call this function.
Last updated