diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-03-11 23:17:21 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-03-11 23:17:21 +0000 |
commit | 897bfe0f72ddc80a020a421cbe987b54716e571e (patch) | |
tree | 4fefcc434abf0e0699f40276efefa71a802457b5 /src/Game/State.hs | |
parent | edc6b611de752a224082583cd00d19ee6da04c5e (diff) | |
download | space-plat-hs-897bfe0f72ddc80a020a421cbe987b54716e571e.tar.gz space-plat-hs-897bfe0f72ddc80a020a421cbe987b54716e571e.zip |
Exit transition
Diffstat (limited to 'src/Game/State.hs')
-rw-r--r-- | src/Game/State.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Game/State.hs b/src/Game/State.hs index 3773268..4f46c01 100644 --- a/src/Game/State.hs +++ b/src/Game/State.hs @@ -1,4 +1,4 @@ -module Game.State (State (..), initialState, levelState, maxLives) where +module Game.State (State (..), initialState, levelState, maxLives, ExitState (..)) where import Game.Entities.Const (hitDelay) import qualified Game.Map as M @@ -6,6 +6,8 @@ import qualified Game.Map as M maxLives :: Int maxLives = 4 +data ExitState = ExitOff | ExitStarted | ExitDone deriving (Eq) + data State = State { batteries :: Int, totalBatteries :: Int, @@ -15,7 +17,7 @@ data State = State gameOverDelay :: Int, exit :: Bool, lastBattery :: (Int, Int), - levelCompleted :: Bool, + levelCompleted :: ExitState, currentLevel :: Int } @@ -31,7 +33,7 @@ initialState m = exit = False, -- doesn't matter where lastBattery = (0, 0), - levelCompleted = False, + levelCompleted = ExitOff, currentLevel = 0 } @@ -45,5 +47,5 @@ levelState s m = exit = False, -- doesn't matter where lastBattery = (0, 0), - levelCompleted = False + levelCompleted = ExitOff } |