From 9dafdb99f0a3504ee1ab5a707273d0ad8b3e88e2 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 26 Dec 2023 21:51:23 +0000 Subject: [PATCH] Make movement always directly responsive to WASD --- src/Dodge/Creature/YourControl.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Dodge/Creature/YourControl.hs b/src/Dodge/Creature/YourControl.hs index 29207c4b8..d173373a1 100644 --- a/src/Dodge/Creature/YourControl.hs +++ b/src/Dodge/Creature/YourControl.hs @@ -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