Work on gibs and chasms
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user