diff --git a/phaser/game-flipbird/assets/flipbird/favicon.ico b/phaser/game-flipbird/assets/flipbird/favicon.ico deleted file mode 100644 index a1aae34..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/favicon.ico and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/gameover.png b/phaser/game-flipbird/assets/flipbird/gameover.png deleted file mode 100644 index 44d4ea9..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/gameover.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/gameoverbg.png b/phaser/game-flipbird/assets/flipbird/gameoverbg.png deleted file mode 100644 index ea30d32..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/gameoverbg.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/getready.png b/phaser/game-flipbird/assets/flipbird/getready.png deleted file mode 100644 index 6916266..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/getready.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/ground.png b/phaser/game-flipbird/assets/flipbird/ground.png deleted file mode 100644 index 4cce60d..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/ground.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/hit.png b/phaser/game-flipbird/assets/flipbird/hit.png deleted file mode 100644 index 2fe4d35..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/hit.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/logo.png b/phaser/game-flipbird/assets/flipbird/logo.png deleted file mode 100644 index bfe32bd..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/logo.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/new.png b/phaser/game-flipbird/assets/flipbird/new.png deleted file mode 100644 index f75d07e..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/new.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/pipe.png b/phaser/game-flipbird/assets/flipbird/pipe.png deleted file mode 100644 index 3a79b27..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/pipe.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/share.png b/phaser/game-flipbird/assets/flipbird/share.png deleted file mode 100644 index e821572..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/share.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/start.png b/phaser/game-flipbird/assets/flipbird/start.png deleted file mode 100644 index f61649e..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/start.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/tip.png b/phaser/game-flipbird/assets/flipbird/tip.png new file mode 100644 index 0000000..897f33a Binary files /dev/null and b/phaser/game-flipbird/assets/flipbird/tip.png differ diff --git a/phaser/game-flipbird/assets/flipbird/touch-icon-iphone-retina.png b/phaser/game-flipbird/assets/flipbird/touch-icon-iphone-retina.png deleted file mode 100644 index 6ed0468..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/touch-icon-iphone-retina.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/touch-icon-iphone.png b/phaser/game-flipbird/assets/flipbird/touch-icon-iphone.png deleted file mode 100644 index 3fe0320..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/touch-icon-iphone.png and /dev/null differ diff --git a/phaser/game-flipbird/assets/flipbird/tweet.png b/phaser/game-flipbird/assets/flipbird/tweet.png deleted file mode 100644 index a07a080..0000000 Binary files a/phaser/game-flipbird/assets/flipbird/tweet.png and /dev/null differ diff --git a/phaser/game-flipbird/scenes/flipbird/flipbird.js b/phaser/game-flipbird/scenes/flipbird/flipbird.js index f54441f..891b9fb 100644 --- a/phaser/game-flipbird/scenes/flipbird/flipbird.js +++ b/phaser/game-flipbird/scenes/flipbird/flipbird.js @@ -1,10 +1,10 @@ import Phaser from "phaser"; -import pipeImg from "../../assets/flipbird/pipe.png"; import pipe1 from "../../assets/flipbird/pipe1.png"; import pipe2 from "../../assets/flipbird/pipe2.png"; import pipe3 from "../../assets/flipbird/pipe3.png"; import birdImg from "../../assets/flipbird/clumsy.png"; import bg from "../../assets/flipbird/bg.png"; +import tip from "../../assets/flipbird/tip.png"; /** * 素材再找 https://github.com/ellisonleao/clumsy-bird/blob/master/data/img/new.png * https://www.emanueleferonato.com/2019/05/02/flappy-bird-html5-prototype-updated-to-phaser-3-16-2/ @@ -41,7 +41,7 @@ export default class PlayScene extends Phaser.Scene { preload() { //this.load.image("bird", "bird.png"); this.load.image("bg", bg); - this.load.image("pipe", pipeImg); + this.load.image("tip", tip); this.load.image("pipe1", pipe1); this.load.image("pipe2", pipe2); this.load.image("pipe3", pipe3); @@ -103,26 +103,36 @@ export default class PlayScene extends Phaser.Scene { 0x000000, 0.6 ); - this.countDown = this.add.text( + const tip = this.add.image( this.game.config.width / 2, this.game.config.height / 2, - "3", - { - fontSize: 110, - textAlign: "center", - baseLine: "middle", - } + "tip" ); - this.time.delayedCall(1000, () => { - this.countDown.text = 2; + tip.displayWidth = 1422 / 2; + tip.displayHeight = 1009 / 2; + this.input.once("pointerdown", () => { + tip.destroy(); + this.countDown = this.add.text( + this.game.config.width / 2, + this.game.config.height / 2, + "3", + { + fontSize: 110, + textAlign: "center", + baseLine: "middle", + } + ); this.time.delayedCall(1000, () => { - this.countDown.text = 1; + this.countDown.text = 2; this.time.delayedCall(1000, () => { - this.countDown.destroy(); - this.countDownWrapper.destroy(); - this.input.on("pointerdown", this.flap, this); - this.pipeGroup.setVelocityX(-this.gameOptions.birdSpeed); - this.bird.body.gravity.y = this.gameOptions.birdGravity; + this.countDown.text = 1; + this.time.delayedCall(1000, () => { + this.countDown.destroy(); + this.countDownWrapper.destroy(); + this.input.on("pointerdown", this.flap, this); + this.pipeGroup.setVelocityX(-this.gameOptions.birdSpeed); + this.bird.body.gravity.y = this.gameOptions.birdGravity; + }); }); }); });