Fix aiming creature direction when zooming

This commit is contained in:
2022-06-05 00:51:53 +01:00
parent 8e73203db3
commit 5e144b1cd5
3 changed files with 14 additions and 9 deletions
+4 -2
View File
@@ -2,6 +2,7 @@ module Dodge.Creature.YourControl
( yourControl
) where
import Dodge.Data
import Dodge.Base.Coordinate
import Dodge.Creature.Impulse.Movement
import Dodge.Update.UsingInput
--import Dodge.Config.KeyConfig
@@ -52,8 +53,9 @@ wasdWithAiming w speed cr
isAiming = _posture (_crStance cr) == Aiming
isReloading = _posture (_crStance cr) == Reloading
mouseDir = case cr ^? crInv . ix (_crInvSel cr) . itScope . scopePos of
Just p -> normalizeAngle $ argV
$ p +.+ 2 / _cameraZoom w *.* rotateV (_cameraRot w) (_mousePos w)
Just _ -> argV $ mouseWorldPos w -.- _crPos cr
-- Just p -> normalizeAngle $ argV
-- $ p +.+ 2 / _cameraZoom w *.* rotateV (_cameraRot w) (_mousePos w)
_ -> normalizeAngle $ argV (_mousePos w) + _cameraRot w
wasdM :: SDL.Scancode -> Point2