Constinue work on respawn

This commit is contained in:
2025-08-14 19:22:26 +01:00
parent dd1f3b2ef5
commit 04c60151e1
7 changed files with 153 additions and 157 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ data LWorld = LWorld
, _imHotkeys :: NewIntMap ItmInt Hotkey
, _lAimPos :: Point2
, _lInvLock :: Bool
, _respawnPos :: Point2
, _respawnPos :: (Point2, Float)
}
--data WorldBeams = WorldBeams
+1 -1
View File
@@ -156,7 +156,7 @@ defaultLWorld =
, _imHotkeys = mempty
, _lAimPos = 0
, _lInvLock = False
, _respawnPos = 0
, _respawnPos = (V2 20 20, pi/2)
}
defaultHUD :: HUD
+1 -2
View File
@@ -13,8 +13,7 @@ splashScreen =
& cWorld . lWorld . creatures .~ IM.fromList [(0, startCr)]
initialWorld :: World
initialWorld =
defaultWorld & spawnAt 0
initialWorld = respawn defaultWorld
-- & wCam . camZoom .~ 10
-- & cWorld . lWorld . creatures .~ IM.fromList [(0, startCr)]
-- & cWorld . lWorld . worldEvents .~ SoundStart BackgroundSound (V2 0 0) foamSprayFadeOutS Nothing :
+1 -5
View File
@@ -34,11 +34,7 @@ rezBox' = do
return $
tToBTree "rezBox'" $
treePost
[ roomRect 40 60 1 1
& rmPmnts .~ [sPS (V2 20 1) 0 $ PutLS col]
& restrictInLinks (\(V2 _ h, _) -> h < 1)
& restrictOutLinks (\(V2 _ h, _) -> h > 59)
& rmName .~ "rezBox"
[ rezBox col
, cleatOnward door
]
+1 -1
View File
@@ -802,7 +802,7 @@ checkEndGame :: Universe -> Universe
checkEndGame uv = case w ^? timeFlow . respawnDelay of
Just x | x < 0 -> uv -- & uvScreenLayers .~ [gameOverMenu uv]
& uvWorld . timeFlow .~ NormalTimeFlow
& uvWorld %~ spawnAt (w ^. cWorld . lWorld . respawnPos)
& uvWorld %~ respawn
Just _ -> uv & uvWorld . timeFlow . respawnDelay -~ 1
_ | _crHP (you w) < 1 -> uv & uvWorld . timeFlow .~ RespawnDelay 50
_ -> uv