aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-03-11 22:14:27 +0000
committerJuan J. Martinez <jjm@usebox.net>2023-03-11 22:14:27 +0000
commit2330f10e9ee28cd6389fccf5f01467bedf6c0266 (patch)
treee712db91ca62392145e6b1037a83eab300b4a2c6
parent45a103da2133b645fac9617cc97c11901d3e258f (diff)
downloadspace-plat-hs-2330f10e9ee28cd6389fccf5f01467bedf6c0266.tar.gz
space-plat-hs-2330f10e9ee28cd6389fccf5f01467bedf6c0266.zip
Add the exit it is drawn before any other entity
-rw-r--r--src/Game/Entities.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Game/Entities.hs b/src/Game/Entities.hs
index bd9729b..b53e4e3 100644
--- a/src/Game/Entities.hs
+++ b/src/Game/Entities.hs
@@ -56,7 +56,7 @@ playerPosition (Entities _ _ entities) =
addExit :: Entities -> Int -> Int -> IO Entities
addExit es x y = do
exit <- mkExit es.sprites x y (collision es.player 24)
- pure es {entities = es.entities ++ [exit]}
+ pure es {entities = head es.entities : exit : tail es.entities}
updateAll :: Entities -> GS.State -> IO (Entities, GS.State)
updateAll es state = do