Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/scenes/levelend-scene.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { loadImages, CLICK, isDocumentVisible } from "@common";
import { loadImages, CLICK, isDocumentVisible, Utils } from "@common";
import { AudioPlayer, Monster } from "@components";
import { CloseButton, NextButton, RetryButton } from "@buttons";
import {
Expand Down Expand Up @@ -147,12 +147,14 @@ export class LevelEndScene {
this.height + this.height * 0.12
);
this.drawStars();

this.monster.update(deltaTime);
this.closeButton.draw();
this.retryButton.draw();
if (this.isLastLevel) {
this.nextButton.draw();

if (!Utils.isRespect) {
this.closeButton.draw();
this.retryButton.draw();
if (this.isLastLevel) {
this.nextButton.draw();
}
}
}
}
Expand Down Expand Up @@ -223,6 +225,10 @@ export class LevelEndScene {
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;

if (Utils.isRespect) {
return;
}
Comment on lines +228 to +230

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Adding this early return disables all click handlers in the LevelEndScene when Utils.isRespect is true. This prevents the user from using the close, retry, or next level buttons. As there appears to be no alternative navigation logic (like an automatic transition), the user will become stuck on this screen after completing a level, which breaks the game's progression. This is a critical issue. An alternative way to navigate from this scene in 'respect' mode should be implemented, for example, by automatically proceeding to the next level after a delay.


if (this.closeButton.onClick(x, y)) {
this.audioPlayer.playButtonClickSound();
this.switchToLevelSelectionCB("LevelEnd");
Expand Down