Improve chaseCrit shape

This commit is contained in:
2026-04-03 15:31:11 +01:00
parent 921f860e83
commit 2d1cf4b371
3 changed files with 13 additions and 12 deletions
+5 -10
View File
@@ -117,19 +117,14 @@ wasdWithAiming w cr = wasdAim inp w $ wasdMovement (w ^. cWorld . lWorld) inp ca
wasdAim :: Input -> World -> Creature -> Creature
wasdAim inp w cr
| SDL.ButtonRight `M.member` _mouseButtons inp
, AtEase <- cr ^. crStance . posture = setposture Aiming (-twoHandTwistAmount)
-- cr
-- & crStance . posture .~ Aiming
-- & doAimTwist (cr ^? crManipulation . manObject . imAimStance) (-twoHandTwistAmount)
| SDL.ButtonRight `M.member` _mouseButtons inp =
aimTurn (w ^. cWorld . lWorld) mousedir cr
, AtEase <- cr ^. crStance . posture =
setposture Aiming (-twoHandTwistAmount)
| SDL.ButtonRight `M.member` _mouseButtons inp = aimTurn (w ^. cWorld . lWorld) mousedir cr
| Aiming{} <- cr ^. crStance . posture = setposture AtEase twoHandTwistAmount
-- cr
-- & crStance . posture .~ AtEase
-- & doAimTwist (cr ^? crManipulation . manObject . imAimStance) twoHandTwistAmount
| otherwise = creatureTurnTowardDir (_crMvAim cr) 0.2 cr
where
setposture x r = cr
setposture x r =
cr
& crStance . posture .~ x
& doAimTwist (cr ^? crManipulation . manObject . imAimStance) r
mousedir = argV $ w ^. cWorld . lWorld . lAimPos - (cr ^. crPos . _xy)