|
|
@ -5,7 +5,6 @@ import pipe2 from "../../assets/flipbird/pipe2.png"; |
|
|
import pipe3 from "../../assets/flipbird/pipe3.png"; |
|
|
import pipe3 from "../../assets/flipbird/pipe3.png"; |
|
|
import birdImg from "../../assets/flipbird/clumsy.png"; |
|
|
import birdImg from "../../assets/flipbird/clumsy.png"; |
|
|
import bg from "../../assets/flipbird/bg.png"; |
|
|
import bg from "../../assets/flipbird/bg.png"; |
|
|
import ground from "../../assets/flipbird/ground.png"; |
|
|
|
|
|
/** |
|
|
/** |
|
|
* 素材再找 https://github.com/ellisonleao/clumsy-bird/blob/master/data/img/new.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/
|
|
|
* https://www.emanueleferonato.com/2019/05/02/flappy-bird-html5-prototype-updated-to-phaser-3-16-2/
|
|
|
@ -45,7 +44,6 @@ export default class PlayScene extends Phaser.Scene { |
|
|
this.load.image("pipe1", pipe1); |
|
|
this.load.image("pipe1", pipe1); |
|
|
this.load.image("pipe2", pipe2); |
|
|
this.load.image("pipe2", pipe2); |
|
|
this.load.image("pipe3", pipe3); |
|
|
this.load.image("pipe3", pipe3); |
|
|
this.load.image("ground", ground); |
|
|
|
|
|
|
|
|
|
|
|
this.load.spritesheet("bird", birdImg, { |
|
|
this.load.spritesheet("bird", birdImg, { |
|
|
frameWidth: 386, |
|
|
frameWidth: 386, |
|
|
@ -85,14 +83,6 @@ export default class PlayScene extends Phaser.Scene { |
|
|
); |
|
|
); |
|
|
this.bird.body.setCircle(342 / 2, 0, 25); |
|
|
this.bird.body.setCircle(342 / 2, 0, 25); |
|
|
this.bird.setScale(0.5); |
|
|
this.bird.setScale(0.5); |
|
|
this.ground = this.add.tileSprite( |
|
|
|
|
|
0, |
|
|
|
|
|
this.game.config.height, |
|
|
|
|
|
this.game.config.width, |
|
|
|
|
|
0, |
|
|
|
|
|
"ground" |
|
|
|
|
|
); |
|
|
|
|
|
this.ground.setOrigin(0); |
|
|
|
|
|
|
|
|
|
|
|
this.bird.body.gravity.y = this.gameOptions.birdGravity; |
|
|
this.bird.body.gravity.y = this.gameOptions.birdGravity; |
|
|
|
|
|
|
|
|
@ -175,7 +165,6 @@ export default class PlayScene extends Phaser.Scene { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, this); |
|
|
}, this); |
|
|
this.ground.tilePositionX += 2; |
|
|
|
|
|
// this.bg.tilePositionY += 0.5
|
|
|
// this.bg.tilePositionY += 0.5
|
|
|
} |
|
|
} |
|
|
die() { |
|
|
die() { |
|
|
|