HTML and CSS Reference
In-Depth Information
context . closePath ();
//restore context
context . restore (); //pop old state on to screen
}
const
const FRAME_RATE = 40 ;
var
var intervalTime = 1000 / FRAME_RATE ;
gameLoop ();
function
function gameLoop () {
runGame ();
window . setTimeout ( gameLoop , intervalTime );
}
We left out the entire application state machine from Example 8-9 to save space. In
Example 8-10 , we are simply showing what the gameStatePlayLevel() function might look
like.
In the section Putting It All Together , we will go into this in greater detail as we start to build
out the entire application.
Search WWH ::




Custom Search