HTML and CSS Reference
In-Depth Information
5. Then, we work on the most important file of this project, the board.js file. It
provides logic about the grid on the board:
var game = this.game || (this.game={});
var createjs = createjs || {};
var lib = lib || {};
;(function(game, cjs, lib){
function Board(){
cjs.Container.call(this); // super
this.x = 10;
this.y = 60;
// grid parameters
this.rows = 10;
this.cols = 7;
this.tileWidth = 87;
this.tileHeight = 83;
// bg graphics
var sprite = new lib.Board();
this.addChild(sprite);
sprite.y = this.tileHeight;
}
Board.prototype = Object.create(cjs.Container.prototype);
game.Board = Board;
}).call(this, game, createjs, lib);
6. Next, we work on the hud.js file that refreshes the head-up display with the latest
game parameters:
var game = this.game || (this.game={});
var createjs = createjs || {};
;(function(game, cjs){
var addButtons = document.querySelectorAll('.add-button');
 
Search WWH ::




Custom Search