From 3e527343fdf5a3372d9994d3a07f9a705996834b Mon Sep 17 00:00:00 2001 From: thirdmadman Date: Mon, 15 Apr 2024 09:42:21 +0200 Subject: [PATCH] fix: correct logic in moveFramePosition --- src/app/App.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/App.ts b/src/app/App.ts index 6994057..19b6291 100644 --- a/src/app/App.ts +++ b/src/app/App.ts @@ -103,13 +103,12 @@ export class App { } moveFramePosition(x: number, y: number) { - if (this.framePositionX <= this.worldSideSize - this.frameWidth + x && this.framePositionX + x >= 0) { + if (this.framePositionX + x <= this.worldSideSize - this.frameWidth && this.framePositionX + x >= 0) { this.framePositionX += x; this.engine.setFramePosition(this.framePositionX, this.framePositionY); - console.error(x); } - if (this.framePositionY <= this.worldSideSize - this.frameHeight + y && this.framePositionY + y >= 0) { + if (this.framePositionY + y <= this.worldSideSize - this.frameHeight && this.framePositionY + y >= 0) { this.framePositionY += y; this.engine.setFramePosition(this.framePositionX, this.framePositionY); }