Add: grilled meat basic sources
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
var SMOKE_START_OFFSET_Y = 200;
|
||||
var SMOKE_SPEED = 1;
|
||||
|
||||
/////////////////////////////
|
||||
// PlusScore Class
|
||||
|
||||
Smoke = function(game, x, y) {
|
||||
Phaser.Sprite.call(this, game, x, y - SMOKE_START_OFFSET_Y, 'smoke');
|
||||
|
||||
// this.anchor.set(0.5);
|
||||
this.scale.set(0.5);
|
||||
// console.log(this);
|
||||
// this.addColor("#ffffff", 0);
|
||||
// this.setStyle(textStyle);
|
||||
|
||||
this.inputEnabled = false;
|
||||
game.time.events.add(Phaser.Timer.SECOND * 1, this.fadePlusScore, this);
|
||||
game.time.events.add(Phaser.Timer.SECOND * 2, this.destroySelf, this);
|
||||
|
||||
game.add.existing(this);
|
||||
}
|
||||
|
||||
Smoke.prototype = Object.create(Phaser.Sprite.prototype);
|
||||
Smoke.prototype.constructor = Smoke;
|
||||
Smoke.prototype.update = function() {
|
||||
this.y -= SMOKE_SPEED;
|
||||
}
|
||||
|
||||
Smoke.prototype.fadePlusScore = function() {
|
||||
game.add.tween(this).to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
|
||||
}
|
||||
|
||||
Smoke.prototype.destroySelf = function() {
|
||||
this.destroy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user