Constinue work on respawn
This commit is contained in:
@@ -151,7 +151,7 @@ data LWorld = LWorld
|
||||
, _imHotkeys :: NewIntMap ItmInt Hotkey
|
||||
, _lAimPos :: Point2
|
||||
, _lInvLock :: Bool
|
||||
, _respawnPos :: Point2
|
||||
, _respawnPos :: (Point2, Float)
|
||||
}
|
||||
|
||||
--data WorldBeams = WorldBeams
|
||||
|
||||
@@ -156,7 +156,7 @@ defaultLWorld =
|
||||
, _imHotkeys = mempty
|
||||
, _lAimPos = 0
|
||||
, _lInvLock = False
|
||||
, _respawnPos = 0
|
||||
, _respawnPos = (V2 20 20, pi/2)
|
||||
}
|
||||
|
||||
defaultHUD :: HUD
|
||||
|
||||
@@ -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 :
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user