aboutsummaryrefslogtreecommitdiff
path: root/src/Game/State.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-03-11 23:17:21 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-03-11 23:17:21 +0000
commit897bfe0f72ddc80a020a421cbe987b54716e571e (patch)
tree4fefcc434abf0e0699f40276efefa71a802457b5 /src/Game/State.hs
parentedc6b611de752a224082583cd00d19ee6da04c5e (diff)
downloadspace-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.hs10
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
}