javascript and browser games
TRANSCRIPT
Javascript e os jogos no browser
por
■
■
■
■
■
■
■
■
■
■
1 ig.module('game.entities.hud')
2 .requires('impact.entity')
3 .defines(function () {
4 EntityHud = ig.Entity.extend({
5 _wmIgnore: true,
6 animSheet: new ig.AnimationSheet('media/hud.png', 10, 10),
7 gravityFactor: 0,
8 zIndex: 2,
9 name: "hud",
10 piece_collected: false,
11
12 init: function (x, y, settings) {
13 this.parent(x, y, settings);
14 this.addAnim('empty', 1, [0]);
15 this.addAnim('full', 1, [1]);
16 },
17
18 update: function () {
19 if( this.piece_collected ){ this.currentAnim = this.anims.full; }
20 this.parent();
21 }
22 });
23 });