Add: alien for test

This commit is contained in:
2018-05-11 10:51:00 +09:00
parent 14ae4a177f
commit 5d2de6b7d6
5 changed files with 24 additions and 5 deletions
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+21 -4
View File
@@ -19,7 +19,15 @@ class Game {
// contents
let alien = game.add.sprite(this.game.world.width / 2, this.game.world.height / 2, 'alien_normal');
alien.anchor.set(0.5);
alien.scale.set(0);
let alienTween = game.add.tween(alien.scale);
// alienTween.to( { x: 4, y: 4 }, 1000, Phaser.Easing.Linear.None, true, 0, -1, true);
// alienTween.yoyo(true, 3000);
alienTween.to( { x: 4, y: 4 }, 1000, Phaser.Easing.Linear.None, false);
alienTween.start();
// bottom
let screenBottom = new ScreenBottom(game);
@@ -29,24 +37,29 @@ class Game {
screenBottom.printBottomCenterText(playingAppName);
screenBottom.printBottomRightText(sessionStorageManager.playerName);
this.countDown();
this.startGame();
// this.countDown();
}
/*
countDown() {
const style = { font: "bold 200px Arial", fill: "#fff",/* align: "center",*/ boundsAlignH: "center", boundsAlignV: "middle" };
const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" };
this.countDownText = game.add.text(0, 0, "", style);
this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height);
this.countDownText.stroke = "#333";
this.countDownText.strokeThickness = 50;
this.countDownNumber = 3;
if(isDebugMode())
this.countDownNumber = 1;
this.tweenCountDown();
}
tweenCountDown() {
console.log(this.countDownNumber);
if(this.countDownNumber === 0)
if(this.countDownNumber === 0) {
this.startGame();
return;
}
this.countDownText.text = this.countDownNumber.toString();
this.countDownText.alpha = 1;
@@ -57,6 +70,10 @@ class Game {
this.countDownNumber--;
}
*/
startGame() {
console.log("startGame");
}
}
+1
View File
@@ -34,6 +34,7 @@ class Loading {
startLoading() {
this.game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
this.game.load.image('alien_normal', '../../../resources/image/character/alien_normal.png');
// this.game.load.image('a', '../../../resources/image/icon/fullscreen_white.png');
// this.game.load.image('b', '../../../resources/image/icon/fullscreen_white.png');
// this.game.load.image('c', '../../../resources/image/icon/fullscreen_white.png');
+2 -1
View File
@@ -5,7 +5,8 @@ const CONTENT_ID = "Space Invaders";
let game = new Phaser.Game(
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
Phaser.CANVAS, CONTENT_ID
Phaser.CANVAS, CONTENT_ID,
this, false, false
);
game.state.add('Loading', Loading);