Work on gibs and chasms

This commit is contained in:
2025-08-01 09:39:13 +01:00
parent 7110ddb7a6
commit eeb7c8ac88
22 changed files with 586 additions and 373 deletions
+2 -5
View File
@@ -2,13 +2,10 @@ module Dodge.Creature.Update (
updateCreature,
) where
import Picture.Base
import LensHelp
import Geometry
import Dodge.SoundLogic
import Dodge.Creature.Radius
import Geometry.Polygon
import Control.Lens
import Dodge.Creature.YourControl
import Dodge.Creature.State
import Dodge.Barreloid
@@ -24,12 +21,12 @@ updateCreature cr = chasmTest cr . case _crType cr of
LampCrit{} -> updateLampoid cr
BarrelCrit bt -> updateBarreloid bt cr
AvatarDead -> id
_ -> updateHumanoid cr
_ -> crUpdate updateHumanoid cr
chasmTest :: Creature -> World -> World
chasmTest cr w
| _crZVel cr < 0 = w & cWorld . lWorld . creatures . ix (_crID cr) . crZVel -~ 1
& cWorld . lWorld . creatures . ix (_crID cr) . crZ +~ (_crZVel cr)
& cWorld . lWorld . creatures . ix (_crID cr) . crZ +~ _crZVel cr
| Just (x,y) <- List.find g (foldMap loopPairs $ w ^. cWorld . chasms) = w
& soundContinue (CrChasm (_crID cr)) (_crPos cr) debrisS (Just 100)
& cWorld . lWorld . creatures . ix (_crID cr) . crPos -~ normalizeV (vNormal (x-y))