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
4 changes: 3 additions & 1 deletion src/main/scala/controller/GameLoop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import model.GameManager
import view.GameView
import scala.swing.Swing
import model.Direction
import scala.annotation.tailrec

private final val DEFAULT_GHOST_DELAY_MS = 350
private final val DEFAULT_GHOST_DELAY_CHASE_MS = 500
Expand All @@ -28,7 +29,8 @@ case class GameLoop(gameManager: GameManager, inputManager: InputManager, view:
* @param lastUpdateTime Timestamp of the last update
* @return Final game state when the game ends
*/
def loop(
@tailrec
final def loop(
state: GameState = GameState.Running,
lastGhostMove: Long = System.currentTimeMillis(),
lastPacmanMove: Long = System.currentTimeMillis(),
Expand Down