From 9508ece9854ff6c5f56865a8cefabf7fd71e261d Mon Sep 17 00:00:00 2001 From: ColorFilter Date: Mon, 5 Feb 2024 02:11:46 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(game.js):=20remove=20unneces?= =?UTF-8?q?sary=20isPassed()=20method=20as=20it=20is=20not=20being=20used?= =?UTF-8?q?=20in=20the=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/game.js b/src/game.js index 28770ea..4954040 100644 --- a/src/game.js +++ b/src/game.js @@ -128,14 +128,13 @@ class Game { case 'obstacle': { this.toggleButtonActive(true); this.failed(); - break; + return; // checkCollision() 반복 호출 종료 } case 'coin': { this.audio.playEffect('coin'); this.score.add(entity.point); entity.touched = true; entity.hide(entity); - break; } } } @@ -160,10 +159,6 @@ class Game { return isHorizontalOverlap && isVerticalOverlap; } - - isPassed(marioRect, obstacleRect) { - return marioRect.left > obstacleRect.right; // 마리오가 장애물 넘었는지 확인 - } } export default Game;