Skip to content

Commit

Permalink
chore: 删除第一关的🕷️
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonlightSmile committed Aug 23, 2021
1 parent 8af3b92 commit 9c95ba1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data/level00.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{ "x": 903, "y": 525 }
],
"hero": { "x": 21, "y": 525 },
"spiders": [{ "x": 121, "y": 399 }],
"spiders": [],
"door": { "x": 231, "y": 546 },
"key": { "x": 525, "y": 336 }
}
2 changes: 1 addition & 1 deletion data/level02.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
{ "x": 500, "y": 147 }
],
"door": { "x": 169, "y": 546 },
"key": { "x": 903, "y": 105 }
"key": { "x": 103, "y": 105 }
}
8 changes: 6 additions & 2 deletions src/scene/Start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class Start extends Phaser.Scene {
this.sound.play("sfx:door");
this.hasKey = false;
this.level += 1;
if (this.level === 3) {
alert("通关");
return;
}
this.scene.restart();
}
}
Expand Down Expand Up @@ -104,7 +108,7 @@ class Start extends Phaser.Scene {
y: "+=6",
ease: "Sine.easeInOut",
repeat: -1,
yoyo: true
yoyo: true,
});
platforms.forEach(this.__spawnPlatform, this);
coins.forEach(this._spawnCoin, this);
Expand Down Expand Up @@ -162,7 +166,7 @@ class Start extends Phaser.Scene {
public update() {
this._inputHander();
this.count.text = `x${String(this.coinPickupCount)}`;
this.spiders.getChildren().forEach(spider => spider.update());
this.spiders.getChildren().forEach((spider) => spider.update());
this.hero.update();
this.keyIcon.setFrame(this.hasKey ? 1 : 0);
this.door.setFrame(this.hasKey ? 1 : 0);
Expand Down

0 comments on commit 9c95ba1

Please sign in to comment.