HTML and CSS Reference
In-Depth Information
As shown in Chapter 1 , we create a gameLoop() function that we call a single time, and it,
in turn, uses a setTimeout() function call to recursively call itself every 20 milliseconds.
This results in the drawScreen() function repeatedly being called. At the bottom of the
drawScreen() function,wesimplyadd 1 tothecurrentvalueof yOffSet .Thiswillcreatethe
illusion of the drawn path moving down the screen.
Search WWH ::




Custom Search