Work on what happens when creatures fall down chasms
This commit is contained in:
@@ -14,8 +14,19 @@ import Dodge.Humanoid
|
||||
import Dodge.Lampoid
|
||||
import qualified Data.List as List
|
||||
|
||||
-- Should separate out creature movement from other parts here
|
||||
|
||||
updateCreature :: Creature -> World -> World
|
||||
updateCreature cr = chasmTest cr . case _crType cr of
|
||||
updateCreature cr
|
||||
| _crZ cr < negate 100 = id -- can remove creature and all items
|
||||
| _crZ cr < 0 = (tocr . crZVel -~ 0.5)
|
||||
. (tocr . crZ +~ _crZVel cr)
|
||||
| otherwise = updateCreature' cr
|
||||
where
|
||||
tocr = cWorld . lWorld . creatures . ix (_crID cr)
|
||||
|
||||
updateCreature' :: Creature -> World -> World
|
||||
updateCreature' cr = chasmTest cr . case _crType cr of
|
||||
Avatar{} -> (cWorld . lWorld . creatures . ix 0 . crType . avatarPulse %~ updatePulse)
|
||||
. crUpdate yourControl cr
|
||||
LampCrit{} -> updateLampoid cr
|
||||
|
||||
Reference in New Issue
Block a user