Fix aiming creature direction when zooming
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user