Cleanup Data
This commit is contained in:
@@ -17,20 +17,13 @@ import qualified SDL as SDL
|
||||
import LoadConfig
|
||||
|
||||
updateCamera :: World -> World
|
||||
updateCamera = rotCam . moveCamera . updateAimTime . updateScopeZoom
|
||||
|
||||
updateAimTime :: World -> World
|
||||
updateAimTime w
|
||||
| SDL.ButtonRight `S.member` _mouseButtons w
|
||||
= w & cameraAimTime %~ \t -> min (t+1) 10
|
||||
| otherwise = w & cameraAimTime %~ \t -> max (t-1) 0
|
||||
updateCamera = rotCam . moveCamera . updateScopeZoom
|
||||
|
||||
moveCamera :: World -> World
|
||||
moveCamera w = w & cameraCenter .~ idealPos
|
||||
& cameraViewFrom .~ sightFrom
|
||||
where aimRangeFactor | _cameraZoom w == 0 = 0
|
||||
| otherwise = (fromMaybe 0 $ yourItem w ^? itAimingRange) / _cameraZoom w
|
||||
aimTimeFactor = fromIntegral (w ^. cameraAimTime) / 10
|
||||
aimingMult | SDL.ButtonRight `S.member` _mouseButtons w = 1
|
||||
| otherwise = 0
|
||||
ypos = _crPos $ you w
|
||||
|
||||
Reference in New Issue
Block a user