diff --git a/resources/image/character/alien.afdesign b/resources/image/character/alien.afdesign new file mode 100644 index 0000000..f43da53 Binary files /dev/null and b/resources/image/character/alien.afdesign differ diff --git a/resources/image/character/alien_normal.png b/resources/image/character/alien_normal.png new file mode 100644 index 0000000..d5b52d1 Binary files /dev/null and b/resources/image/character/alien_normal.png differ diff --git a/src/game/mouse/space_invaders/game.js b/src/game/mouse/space_invaders/game.js index c08eca9..46ed3ae 100644 --- a/src/game/mouse/space_invaders/game.js +++ b/src/game/mouse/space_invaders/game.js @@ -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"); + } } \ No newline at end of file diff --git a/src/game/mouse/space_invaders/loading.js b/src/game/mouse/space_invaders/loading.js index 02c481f..b92c5f9 100644 --- a/src/game/mouse/space_invaders/loading.js +++ b/src/game/mouse/space_invaders/loading.js @@ -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'); diff --git a/src/game/mouse/space_invaders/main.js b/src/game/mouse/space_invaders/main.js index 55e0a87..a97af32 100644 --- a/src/game/mouse/space_invaders/main.js +++ b/src/game/mouse/space_invaders/main.js @@ -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);