HTML and CSS Reference
In-Depth Information
4. In the last task, we pause the icker whenever the game is over. We go one step
further to show the game overlay in this task:
game.gameOver = function() {
Objective complete - mini debriefing
We have created a game-over scene and are now able to restart the game. The game-over
scene makes use of the DOM element overlay on top of the canvas game. This allows us to
use the CSS hover and active pseudo classes for the buton efect. We are not locked into
any one library even when we use a canvas to render our game elements. From the Web, we
can choose the soluion that's most suitable. Overlaying a DOM element is not a bad idea at
all before we learn to create butons using the CreateJS library.
Classified intel
Before the game starts over again, we reset the game to its iniial state. Reseing the game
means that we remove all the exising boxes and reset the lives. Ater the reset is complete,
we resume the game and the game starts over and runs again.
Pausing the game
If we want to let the player pause the game in the middle, we can overlay a pause screen
similar to the game-over screen and also pause the icker. Then, we may provide a pause
buton to trigger the pause state.
Search WWH ::

Custom Search