-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
gameWithLives :: Int -> Int -> Int -> SF Controller GameState
gameWithLives numLives level pts = dSwitch
-- Run normal game until level is completed
(gamePlayOrPause numLives level pts >>> (arr id &&& isLevelCompleted))
-- Take last game state, extract basic info, and load the next level
(\g -> let level' = level + 1
lives' = gameLives $ gameInfo g
pts = gamePoints $ gameInfo g
in runLevel lives' level' pts)
Is there a reason, why state-passing is done with 3 explicit arguments, instead of packing them into a state-holding datatype?
For instance, can we not, instead of this:
gameWithLives :: Int -> Int -> Int -> ...
Have this?:
gameWithLives :: GameState ->...
Reactions are currently unavailable