Tweak walk cycle parameters

This commit is contained in:
2021-06-09 00:01:56 +02:00
parent fb7a90df71
commit 3371e2ae79
16 changed files with 112 additions and 81 deletions
+3 -2
View File
@@ -24,7 +24,7 @@ yourControl w (f,g) cr =
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
)
where
speed = 3
speed = 4
{- | Turn key presses into creature movement. -}
wasdWithAiming
:: World
@@ -35,12 +35,13 @@ wasdWithAiming
wasdWithAiming w speed i cr
| isAiming = set crDir mouseDir $ crMvBy (speed *.* mov) cr
| isMoving = crMvAbsolute (speed *.* movAbs) $ turnAction cr
-- | isMoving = crMvAbsolute (speed *.* movAbs) cr
-- | isMoving = crMvForward speed $ over crDir (`fromMaybe` dir) cr
| otherwise = cr
where
(mov',dir') = wasdComp (view keys w) w
dir = fmap (_cameraRot w +) dir'
turnAction cr' = maybe cr (\d -> creatureTurnTowardDir d 0.2 cr') dir
turnAction cr' = maybe cr' (\d -> creatureTurnTowardDir d 0.2 cr') dir
movAbs = rotateV (_cameraRot w) mov'
mov = rotateV (negate $ _crDir cr - _cameraRot w) mov'
isAiming = _posture (_crStance cr) == Aiming