Game Development Reference
In-Depth Information
Figure 7-6. The complete dice tray container added to the stage
Building the Scorecard
Next up is the scorecard, which takes up most of the screen in Fakezee. It contains all of the category options, the total
score, and eventually the Play Again button, which will start a brand new game. The buildScoreCard function creates
all of these assets and places them into a single container. Listing 7-13 kicks off this function with several variables for
display objects and positioning.
Listing 7-13. The buildScoreCard Function Builds the Scoreboard Container
function buildScoreCard() {
var i, btn, scoreMsg, scoreTxt;
var xPos = 0;
var yPos = 0;
var row = 0;
var hGap = 49;
var vGap = 390;
var btnsPerRow = 6;
var fakezeeBtnYPos = 75;
var scoreMsgYPos = 150;
var section = 1;
scoreCard = new createjs.Container();
scoreCard.mouseEnabled = false;
scoreCard.x = SCORE_CARD_POSITION.x;
scoreCard.y = SCORE_CARD_POSITION.y;
...
 
Search WWH ::




Custom Search