HTML5 Canvas [204]
var verticalSpacing = 14;
console.log("text=" + this.text)
console.log("text split length=" + splitText.length)
for (var ctr1=0; ctr1 yPosition+ (ctr1*verticalSpacing)); } context.restore(); } This object prototype contains functions for creating, drawing, and clicking a gray square button with black text on it. When clicked, the button will be drawn with a yellow background. We have covered all these drawing functions earlier in this book, so they will look familiar to you if you have read those chapters. If you have not, it’s especially a good idea to read Chapter 2, which covers drawing and shading objects drawn with paths. Let’s now take a quick look at the functions we have created in BSBingo.html. The initLists() function The initButtons() function The initSounds() function
The first game-related function you will encounter is initLists(). For our simple game implementation, we have created a single list of words based on some common business jargon. The standardJargonList application scope variable will contain a single-dimension array of words that will be placed randomly on the player’s bingo card. We can add more types of lists if we would like to target other types of jargon-speak, such as pure IT process-speak, marketing-speak, or even sports- or geek-speak.
This function creates a grid of 25 TextButton instances, 85 pixels in width and 25 in height. These are stored in the application scope buttons two-dimensional array so they can be accessed via the [row][column] syntax.
The initSounds() function needs to initialize only a single sound referenced in an HTML5