(fix) ゲームが正常に終了するように

This commit is contained in:
kakkokari-gtyih 2024-01-08 17:25:48 +09:00
parent 04f9147db6
commit accee5dfc8
2 changed files with 5 additions and 2 deletions

View File

@ -440,6 +440,7 @@ function restart() {
score.value = 0;
combo.value = 0;
comboPrev.value = 0;
bgmNodes?.soundSource.stop();
gameStarted.value = false;
}
@ -610,8 +611,9 @@ async function share() {
os.post({
initialText: `#BubbleGame
MODE: ${gameMode.value}
SCORE: ${score.value} (MAX CHAIN: ${maxCombo.value})})`,
SCORE: ${score.value} (MAX CHAIN: ${maxCombo.value})`,
initialFiles: [file],
instant: true,
});
}
@ -625,7 +627,7 @@ useInterval(() => {
}, 1000, { immediate: false, afterMounted: true });
onDeactivated(() => {
game.dispose();
restart();
});
definePageMetadata({

View File

@ -183,6 +183,7 @@ export class DropAndFusionGame extends EventEmitter<{
};
if (mono.shape === 'circle') {
return Matter.Bodies.circle(x, y, mono.size / 2, options);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if (mono.shape === 'rectangle') {
return Matter.Bodies.rectangle(x, y, mono.size, mono.size, options);
} else {