Game Development Reference
In-Depth Information
Figure 11-10. The main menu scene with crawling title and play button
Creating the Game Scene
The game scene is where all of the game-playing magic takes place. There is quite a bit of code that will go into it, so a
template for the class is temporarily made so you can finish up the application classes before diving into game code.
The start of the Game class is shown in Listing 11-13.
Listing 11-13. The Game Scene Class Template, Declared in Game.js
(function (window) {
window.game = window.game || {}
function Game() {
this.initialize();
}
var p = Game.prototype = new createjs.Container();
p.Container_initialize = p.initialize;
p.initialize = function () {
this.Container_initialize();
var me = this;
 
Search WWH ::




Custom Search