Cleanup
This commit is contained in:
@@ -16,9 +16,8 @@ import Data.Maybe
|
||||
yourControl :: Creature -> World -> World
|
||||
yourControl cr w = w
|
||||
& updateUsingInput
|
||||
& creatures . ix (_crID cr) %~ (mouseActionsCr (_mouseButtons w) . wasdWithAiming w speed)
|
||||
where
|
||||
speed = _mvSpeed $ _crMvType cr
|
||||
& creatures . ix (_crID cr) %~
|
||||
(mouseActionsCr (_mouseButtons w) . wasdWithAiming w (_mvSpeed $ _crMvType cr))
|
||||
|
||||
{- | Turn key presses into creature movement. -}
|
||||
wasdWithAiming
|
||||
@@ -51,8 +50,7 @@ wasdWithAiming w speed cr
|
||||
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)
|
||||
$ 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