Refactor creature ai
This commit is contained in:
@@ -24,7 +24,7 @@ yourControl w (f,g) cr =
|
||||
, Just . mouseActionsCr (_mouseButtons w) $ wasdWithAiming w speed 0 cr
|
||||
)
|
||||
where
|
||||
speed = _varMovementSpeedModifier w * equipFactor
|
||||
speed = 3 * equipFactor
|
||||
equipFactor = product $ map equipSpeed $ IM.elems $ _crInv $ _creatures w IM.! 0
|
||||
{- | Turn key presses into creature movement. -}
|
||||
wasdWithAiming
|
||||
@@ -50,7 +50,6 @@ wasdWithAiming w speed i cr
|
||||
*.* rotateV (_cameraRot w) (_mousePos w)
|
||||
_ -> normalizeAngle $ argV (_mousePos w) + _cameraRot w
|
||||
|
||||
|
||||
wasdM :: World -> SDL.Scancode -> Point2
|
||||
wasdM w scancode
|
||||
| scancode == moveUpKey (_keyConfig w) = ( 0, 1)
|
||||
|
||||
Reference in New Issue
Block a user