Game Development Reference
In-Depth Information
Under the
buildScoreCard
function, uncomment
•
btn.paused = true;
(in button creating loop)
•
btn.alpha = 0;
(fakezee button)
•
scoreMsg.alpha = 0;
•
scoreTxt.alpha = 0;
3.
Under the
buildScoreboard
function, uncomment
•
scoreboard.alpha = 0;
4.
Now when you run your game, you should get an empty stage, showing nothing but the background image in the
DOM element behind it (see Figure
7-10
).
Figure 7-10.
The game's sprites and containers are initially hidden and ready for a grand entrance
Now that everything is hidden, the
revealGame
function needs to be called to fire each revealing animation.
A series of timeouts are chained together by utilizing TweenJS. This will create a short delay before each section starts
their animations (see Listing 7-17).
Listing 7-17.
Each Section Holds its Own Revealing Function
function revealGame() {
createjs.Tween.get(this)
.wait(100).call(revealTitle)
.wait(400).call(revealDiceTray)
.wait(1400).call(revealScoreCard)
.wait(2000).call(revealScoreboard);
}