|
|
|
@ -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,6 +103,15 @@ export default class PlayScene extends Phaser.Scene { |
|
|
|
0x000000, |
|
|
|
0.6 |
|
|
|
); |
|
|
|
const tip = this.add.image( |
|
|
|
this.game.config.width / 2, |
|
|
|
this.game.config.height / 2, |
|
|
|
"tip" |
|
|
|
); |
|
|
|
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, |
|
|
|
@ -126,6 +135,7 @@ export default class PlayScene extends Phaser.Scene { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
updateScore(inc) { |
|
|
|
this.score += inc; |
|
|
|
|