Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

5.2. The Game Code

This section examines the entire code for the game, deconstructing all the game elements and covering them in detail.

5.2.1. Game-Wide Variables

Here, the various game variables are defined; for clarity and convenience, the unchanging constants appear in all uppercase. $drawTarget refers to the play area, which is defined as a div element within the page:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial