/////////////////////////////
// PlusScore Class

PlusScore = function(backupX, backupY, scoreValue) {
	var textStyle = { font: "normal 24px Arial", fill: "#ff0", boundsAlignH: "center", boundsAlignV: "middle" };

	Phaser.Text.call(this, game, backupX, backupY, "+" + scoreValue);

	this.anchor.set(0.5);
	// console.log(this);
	// this.addColor("#ffffff", 0);
	// this.setStyle(textStyle);

	var grd = this.context.createLinearGradient(0, 0, 0, this.height);
	grd.addColorStop(0, '#8ED6FF');   
	grd.addColorStop(1, '#004CB3');
	this.fill = grd;

	// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
	this.stroke = '#fff';
	this.strokeThickness = 5;
	// this.addStrokeColor('#f00', 13);

	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);
}

PlusScore.prototype = Object.create(Phaser.Text.prototype);
PlusScore.prototype.constructor = PlusScore;
PlusScore.prototype.update = function() {
	this.y -= 0.3;
}

PlusScore.prototype.fadePlusScore = function() {
	game.add.tween(this).to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
}

PlusScore.prototype.destroySelf = function() {
	this.destroy();
}


