Browse Source

同色消除提示点任意地方都能关闭,加速进场动画

master
jiannibang 6 years ago
parent
commit
c7ee54b20f
  1. 19
      phaser/game-flood-fill/scenes/PlayScene.js

19
phaser/game-flood-fill/scenes/PlayScene.js

@ -128,6 +128,10 @@ class PlayScene extends Phaser.Scene {
); );
//初始化位置 //初始化位置
this.revealGrid(); this.revealGrid();
this.input.once("pointerdown", () => {
this.instructionWrapper.setVisible(false);
this.instructions.setVisible(false);
});
} }
update() {} update() {}
@ -158,11 +162,11 @@ class PlayScene extends Phaser.Scene {
revealGrid() { revealGrid() {
this.tweens.add({ this.tweens.add({
targets: this.gridBG, targets: this.gridBG,
y: 300,
y: 150,
ease: "Power3", ease: "Power3",
}); });
var i = 500;
var i = 250;
for (var y = 13; y >= 0; y--) { for (var y = 13; y >= 0; y--) {
for (var x = 0; x < 14; x++) { for (var x = 0; x < 14; x++) {
@ -174,7 +178,7 @@ class PlayScene extends Phaser.Scene {
y: block.getData("y"), y: block.getData("y"),
ease: "Power3", ease: "Power3",
duration: 500,
duration: 250,
delay: i, delay: i,
}); });
@ -182,7 +186,7 @@ class PlayScene extends Phaser.Scene {
} }
} }
i -= 1000;
i -= 500;
// Text // Text
@ -193,7 +197,7 @@ class PlayScene extends Phaser.Scene {
delay: i, delay: i,
}); });
i += 500;
i += 250;
var movesTween = this.tweens.addCounter({ var movesTween = this.tweens.addCounter({
from: 0, from: 0,
@ -208,7 +212,7 @@ class PlayScene extends Phaser.Scene {
delay: i, delay: i,
}); });
i += 500;
i += 250;
this.tweens.add({ this.tweens.add({
targets: [this.instructions, this.instructionWrapper], targets: [this.instructions, this.instructionWrapper],
@ -269,9 +273,6 @@ class PlayScene extends Phaser.Scene {
this.matched = []; this.matched = [];
this.instructionWrapper.setVisible(false);
this.instructions.setVisible(false);
this.moves--; this.moves--;
this.text2.setText(Phaser.Utils.String.Pad(this.moves, 2, "0", 1)); this.text2.setText(Phaser.Utils.String.Pad(this.moves, 2, "0", 1));

Loading…
Cancel
Save