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;