Simplify walk cycle (may decrease frame rate?)
This commit is contained in:
@@ -62,9 +62,10 @@ crUpdate f =
|
||||
foldCr
|
||||
[ doDamage -- these two
|
||||
, checkDeath -- must be in this order 24/7/22
|
||||
, internalCreatureUpdate
|
||||
, f
|
||||
-- , internalCreatureUpdate
|
||||
, footstepSideEffect
|
||||
, f
|
||||
-- , footstepSideEffect
|
||||
-- , updateInv -- upInv must be called before invSideEff 22.05.23
|
||||
, invRootItemEffs
|
||||
, invSideEff
|
||||
@@ -425,9 +426,9 @@ updateMovement cr
|
||||
| isFrictionless cr = over crPos (+.+ momentum) cr
|
||||
| otherwise = cr & crStance %~ updateWalkCycle
|
||||
where
|
||||
momentum' = 0.98 *.* (_crPos cr -.- _crOldPos cr)
|
||||
momentum' = 0.98 *.* (_crPos cr - _crOldPos cr)
|
||||
momentum
|
||||
| magV momentum' > 1 = 1 *.* normalizeV momentum'
|
||||
| magV momentum' > 1 = normalizeV momentum'
|
||||
| otherwise = momentum'
|
||||
|
||||
isFrictionless :: Creature -> Bool
|
||||
|
||||
Reference in New Issue
Block a user