Implement moving wall push and crush
This commit is contained in:
+5
-2
@@ -45,7 +45,7 @@ update w
|
||||
. wallEvents
|
||||
. set worldEvents id
|
||||
$ _worldEvents w1 w1
|
||||
where -- zoning w = set wallsZone (IM.foldr wallInZone IM.empty (_walls w))
|
||||
where -- zoning w = set wallsZone (IM.foldr wallInZone IM.empty (_walls w))
|
||||
-- w
|
||||
-- wallInZone wl | dist (_wlLine wl !! 0) (_wlLine wl !! 1) <= 2*zoneSize
|
||||
-- = insertIMInZone x y wlid wl
|
||||
@@ -76,7 +76,10 @@ updateParticles' w = set particles' (catMaybes ps) w'
|
||||
|
||||
updateCreatures :: World -> World
|
||||
updateCreatures w = f $ set randGen newG $ set creatures (IM.mapMaybe id crs) w
|
||||
where ((f,newG),crs) = IM.mapAccum (\g' cr -> _crUpdate cr w g' cr) (id,_randGen w) $ _creatures w
|
||||
where
|
||||
((f,newG),crs) = IM.mapAccum (\g' cr -> _crUpdate cr w g' (setOldPos cr)) (id,_randGen w)
|
||||
$ _creatures w
|
||||
setOldPos cr = cr & crOldPos .~ _crPos cr
|
||||
|
||||
|
||||
wallEvents :: World -> World
|
||||
|
||||
Reference in New Issue
Block a user