This commit is contained in:
jgk
2021-03-24 00:21:07 +01:00
parent 746f905ba1
commit 26ac0142b1
2 changed files with 18 additions and 24 deletions
+18 -20
View File
@@ -26,25 +26,23 @@ update :: World -> World
update w
| _menuState w /= InGame = w
| otherwise =
let w1 = updateParticles' $ updateParticles
$ updateLightSources
$ zoneClouds
$ updateClouds
$ updateCreatures
$ updateBlocks -- $ zoning
$ updateSeenWalls
$ updateSoundQueue
$ updateCloseObjects
w
w2 = -- updateWeaponCounters $
simpleCrSprings
$ zoneCreatures $ wallEvents
$ set worldEvents id $ _worldEvents w1
w1
w3 = updateCamera
$ colCrsWalls
w2
in checkEndGame $ ppEvents w3
let w1 = updateParticles' . updateProjectiles
. updateLightSources
. zoneClouds
. updateClouds
. updateCreatures
. updateBlocks -- . zoning
. updateSeenWalls
. updateSoundQueue
$ updateCloseObjects w
in checkEndGame . ppEvents
. updateCamera
. colCrsWalls
. simpleCrSprings
. zoneCreatures
. wallEvents
. set worldEvents id
$ _worldEvents w1 w1
where -- zoning w = set wallsZone (IM.foldr wallInZone IM.empty (_walls w))
-- w
-- wallInZone wl | dist (_wlLine wl !! 0) (_wlLine wl !! 1) <= 2*zoneSize
@@ -68,7 +66,7 @@ updateSoundQueue = set soundQueue []
updateLightSources w = set tempLightSources (catMaybes tlss) w'
where (w',tlss) = mapAccumR (\a b -> _tlsUpdate b a b) w $ _tempLightSources w
updateParticles w = IM.foldr' _ptUpdate w $ _projectiles w
updateProjectiles w = IM.foldr' _ptUpdate w $ _projectiles w
updateParticles' :: World -> World
updateParticles' w = set particles' (catMaybes ps) w'