Add: alien for test
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -19,7 +19,15 @@ class Game {
|
|||||||
|
|
||||||
|
|
||||||
// contents
|
// 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
|
// bottom
|
||||||
let screenBottom = new ScreenBottom(game);
|
let screenBottom = new ScreenBottom(game);
|
||||||
@@ -29,24 +37,29 @@ class Game {
|
|||||||
screenBottom.printBottomCenterText(playingAppName);
|
screenBottom.printBottomCenterText(playingAppName);
|
||||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||||
|
|
||||||
this.countDown();
|
this.startGame();
|
||||||
|
// this.countDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
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 = game.add.text(0, 0, "", style);
|
||||||
this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height);
|
this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height);
|
||||||
this.countDownText.stroke = "#333";
|
this.countDownText.stroke = "#333";
|
||||||
this.countDownText.strokeThickness = 50;
|
this.countDownText.strokeThickness = 50;
|
||||||
|
|
||||||
this.countDownNumber = 3;
|
this.countDownNumber = 3;
|
||||||
|
if(isDebugMode())
|
||||||
|
this.countDownNumber = 1;
|
||||||
this.tweenCountDown();
|
this.tweenCountDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
tweenCountDown() {
|
tweenCountDown() {
|
||||||
console.log(this.countDownNumber);
|
if(this.countDownNumber === 0) {
|
||||||
if(this.countDownNumber === 0)
|
this.startGame();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.countDownText.text = this.countDownNumber.toString();
|
this.countDownText.text = this.countDownNumber.toString();
|
||||||
this.countDownText.alpha = 1;
|
this.countDownText.alpha = 1;
|
||||||
@@ -57,6 +70,10 @@ class Game {
|
|||||||
|
|
||||||
this.countDownNumber--;
|
this.countDownNumber--;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
startGame() {
|
||||||
|
console.log("startGame");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,7 @@ class Loading {
|
|||||||
|
|
||||||
startLoading() {
|
startLoading() {
|
||||||
this.game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
|
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('a', '../../../resources/image/icon/fullscreen_white.png');
|
||||||
// this.game.load.image('b', '../../../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');
|
// this.game.load.image('c', '../../../resources/image/icon/fullscreen_white.png');
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ const CONTENT_ID = "Space Invaders";
|
|||||||
|
|
||||||
let game = new Phaser.Game(
|
let game = new Phaser.Game(
|
||||||
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
|
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
|
||||||
Phaser.CANVAS, CONTENT_ID
|
Phaser.CANVAS, CONTENT_ID,
|
||||||
|
this, false, false
|
||||||
);
|
);
|
||||||
|
|
||||||
game.state.add('Loading', Loading);
|
game.state.add('Loading', Loading);
|
||||||
|
|||||||
Reference in New Issue
Block a user