Test making walking movement slightly more floaty

This commit is contained in:
2026-04-03 19:52:56 +01:00
parent 2b2ac53466
commit 47ecfb7fd3
10 changed files with 35 additions and 45 deletions
+4 -8
View File
@@ -23,16 +23,12 @@ import NewInt
import qualified SDL
-- | The AI equivalent for your control.
yourControl :: Creature -> World -> World
yourControl _ w
yourControl :: World -> World
yourControl w
| inTextInputFocus w = w
| NoSubInventory <- w ^. hud . subInventory =
w
& cWorld
. lWorld
. creatures
. ix 0
%~ wasdWithAiming w
& cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
& tryClickUse (w ^. input . mouseButtons)
& handleHotkeys
| otherwise = w & cWorld . lWorld . creatures . ix 0 %~ wasdWithAiming w
@@ -147,7 +143,7 @@ wasdMovement lw inp cam speed = theMovement . setMvAim
movAbs = rotateV (cam ^. camRot) $ normalizeV movDir
theMovement
| movDir == V2 0 0 = id
| otherwise = crMvAbsolute lw (speed *.* movAbs)
| otherwise = crMvAbsolute lw (speed *^ movAbs)
aimTurn :: LWorld -> Float -> Creature -> Creature
aimTurn lw a cr = creatureTurnTowardDir a (x * 0.2) cr