Skip to content
Snippets Groups Projects
Commit 23d26f72 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: #be #fe track game end

parent b147bf48
No related branches found
No related tags found
No related merge requests found
Pipeline #23676 failed
......@@ -224,11 +224,17 @@ export default class FightScene extends Phaser.Scene {
checkAlive() {
if (this.health > 0) return;
this.endGame();
}
async endGame() {
this.beGame = (
await backend.updateGame(this.beGame.id, {
began_at: this.beGame.began_at, // TODO: make this optional in the type
ended_at: new Date().toISOString(),
})
).data;
this.foes.forEach((foe) => foe.destroy());
// this.scene.transition({
// target: "game_over",
// });
// // this.scene.stop();
this.scene.start("game_over");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment