Fix: spaceship image, start random flyingsaucer

This commit is contained in:
2019-01-10 13:07:09 +09:00
parent b8faa417d8
commit 33c70e6d5c
10 changed files with 155 additions and 84 deletions
+36 -19
View File
@@ -1,15 +1,14 @@
CenterMessageText.prototype = Object.create(Phaser.Text.prototype);
CenterMessageText.constructor = CenterMessageText;
function CenterMessageText(contentText) {
function CenterMessageText() {
Phaser.Text.call(
this, game,
game.world.width / 2,
game.world.height / 2 - CenterMessageText.MOVE_AMOUNT_PX,
contentText,
"",
CenterMessageText.DEFAULT_TEXT_FONT
);
// super(game, 600, 300, "게임 오버", CenterMessageText.DEFAULT_TEXT_FONT);
this.anchor.set(0.5);
this.inputEnabled = false;
@@ -18,37 +17,55 @@ function CenterMessageText(contentText) {
// grd.addColorStop(0, CenterMessageText.COLOR_GRADATION_START); //'#FFD68E');
// grd.addColorStop(1, CenterMessageText.COLOR_GRADATION_END); //'#B34C00');
// this.fill = grd;
this.fill = CenterMessageText.COLOR_TEXT;
// this.fill = CenterMessageText.COLOR_TEXT;
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
this.stroke = CenterMessageText.COLOR_STROKE;
this.strokeThickness = 9;
this.tweenAlpha = game.add.tween(this);
this.tweenAlpha.to( { alpha: 0 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Elastic.In, false);
// this.tweenAlpha.onComplete.addOnce(this.hide, this);
this.alpha = 1;
var tweenAlpha = game.add.tween(this);
tweenAlpha.to( { alpha: 0 }, CenterMessageText.TWEEN_ALPHA_TIME, Phaser.Easing.Elastic.In, true);
tweenAlpha.onComplete.addOnce(this.destroy, this);
// var tweenScale = game.add.tween(this.scale);
// tweenScale.to( { x: 0.8, y: 0.8 }, CenterMessageText.TWEEN_SCALE_TIME, Phaser.Easing.Bounce.Out, true);
// tweenScale.onComplete.addOnce(this.destroy, this);
this.timerEventTween = null;
this.alpha = 0;
game.add.existing(this);
};
CenterMessageText.prototype.showText = function(wordLevel, wordLevelText) {
if(this.timerEventTween)
game.time.events.remove(this.timerEventTween);
if(this.tweenAlpha != null)
this.tweenAlpha.stop();
this.text = "[ " + wordLevelText + " ] 단계 활성화";
this.fill = GameLevelManager.CENTER_MESSAGE_TEXT_COLOR_LIST[wordLevel];
this.stroke = GameLevelManager.CENTER_MESSAGE_STROKE_COLOR_LIST[wordLevel];
// console.log(this.fill);
// console.log(this.stroke);
this.alpha = 1;
this.tweenAlpha.start();
this.timerEventTween = game.time.events.add(CenterMessageText.TWEEN_ALPHA_TIME, this.hide, this);
}
CenterMessageText.prototype.hide = function() {
this.alpha = 0;
}
CenterMessageText.DEFAULT_TEXT_FONT = {
font: "bold 40px Arial", // "bold 100px Arial",
font: "bold 40px Arial",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: CenterMessageText.COLOR_TEXT // "#fff"
fill: "#ffffff"
};
CenterMessageText.MOVE_AMOUNT_PX = 100;
CenterMessageText.TWEEN_ALPHA_TIME = 1500;
CenterMessageText.TWEEN_SCALE_TIME = 1500;
CenterMessageText.COLOR_TEXT = "#ffcc00"; // "#cc9900";
CenterMessageText.COLOR_GRADATION_START = "#B34C00"; // "#333333"; //"#666666";
CenterMessageText.COLOR_GRADATION_END = "#333333"; // "#B34C00";
CenterMessageText.COLOR_STROKE = "#663300"; //"#FFDD88"; //"#FFD68E";
CenterMessageText.COLOR_TEXT = "#ffcc00";
CenterMessageText.COLOR_GRADATION_START = "#B34C00";
CenterMessageText.COLOR_GRADATION_END = "#333333";
CenterMessageText.COLOR_STROKE = "#663300";