Make movement always directly responsive to WASD

This commit is contained in:
2023-12-26 21:51:23 +00:00
parent 26c55ee7f5
commit 9dafdb99f0
+2 -7
View File
@@ -105,7 +105,8 @@ wasdWithAiming w speed cr
| isAiming = addAnyTwist $ aimTurn mouseDir $ theMovement $ setMvAim cr
| crIsReloading cr && SDL.ButtonRight `M.member` _mouseButtons (_input w) =
aimTurn mouseDir $ removeTwist $ theMovement $ setMvAim cr
| otherwise = noaimmove $ theTurn $ removeTwist $ setMvAim cr
-- | otherwise = noaimmove $ theTurn $ removeTwist $ setMvAim cr
| otherwise = theMovement $ theTurn $ removeTwist $ setMvAim cr
where
setMvAim = maybe id (crMvAim .~) dir
twistamount = 1.6
@@ -134,12 +135,6 @@ wasdWithAiming w speed cr
movAbs = rotateV (w ^. wCam . camRot) $ normalizeV movDir
isAiming = _posture (_crStance cr) == Aiming
mouseDir = argV $ mouseWorldPos (w ^. input) (w ^. wCam) - (cr ^. crPos)
-- mouseDir = fromMaybe
-- (argV (_mousePos (_input w)) + (w ^. wCam . camRot))
-- $ do
-- itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
-- _ <- cr ^? crInv . ix itRef . itScope . remotePos
-- return . argV $ mouseWorldPos (w ^. input) (w ^. wCam) -.- _crPos cr
aimTurn :: Float -> Creature -> Creature
aimTurn a cr = creatureTurnTowardDir a (x * 0.2) cr