Fix zoom bug
This commit is contained in:
@@ -45,16 +45,16 @@ chaseCrit =
|
||||
|
||||
chaseCritVocalization :: Vocalization
|
||||
chaseCritVocalization =
|
||||
Vocalization
|
||||
seagullChatterS
|
||||
[ seagullBarkS
|
||||
, seagullChatterS
|
||||
, seagullChatter1S
|
||||
, seagullWhistleS
|
||||
, seagullWhistle1S
|
||||
, seagullCryS
|
||||
, seagullCry1S
|
||||
, seagullCry2S
|
||||
]
|
||||
(50,100)
|
||||
0
|
||||
Vocalization
|
||||
seagullChatterS
|
||||
[ seagullBarkS
|
||||
, seagullChatterS
|
||||
, seagullChatter1S
|
||||
, seagullWhistleS
|
||||
, seagullWhistle1S
|
||||
, seagullCryS
|
||||
, seagullCry1S
|
||||
, seagullCry2S
|
||||
]
|
||||
(50, 200)
|
||||
0
|
||||
|
||||
+10
-20
@@ -159,28 +159,18 @@ zoomSpeed :: Float
|
||||
zoomSpeed = 39 / 40
|
||||
|
||||
zoomInLongGun :: Point2 -> Scope -> Scope
|
||||
zoomInLongGun mousep sc
|
||||
| currentZoom < 8 =
|
||||
sc
|
||||
& scopePos .+.+~ (1 - zoomSpeed) / newzoom *.* mousep
|
||||
& scopeZoom %~ (/ zoomSpeed)
|
||||
| otherwise = sc
|
||||
where
|
||||
Just currentZoom = sc ^? scopeZoom
|
||||
newzoom = (sc ^?! scopeZoom) / zoomSpeed
|
||||
zoomInLongGun mousep sc = fromMaybe sc $ do
|
||||
curzoom <- sc ^? scopeZoom
|
||||
guard $ curzoom < 8
|
||||
return $ sc & scopePos .+.+~ (1 - zoomSpeed)*zoomSpeed/curzoom *.* mousep
|
||||
& scopeZoom %~ (/ zoomSpeed)
|
||||
|
||||
zoomOutLongGun :: Scope -> Scope
|
||||
zoomOutLongGun sc
|
||||
| currentzoom > 0.5 =
|
||||
sc
|
||||
& scopePos %~ (\p -> p +.+ (zoomSpeed-1) / currentzoom *.* p)
|
||||
-- & scopePos .*.*~ 1 - ((newzoom * 2) ** zoomSpeed)
|
||||
& scopeZoom *~ zoomSpeed
|
||||
| otherwise = sc
|
||||
& scopePos .~ V2 0 0
|
||||
where
|
||||
Just currentzoom = sc ^? scopeZoom
|
||||
--newzoom = (sc ^?! scopeZoom) / zoomSpeed
|
||||
zoomOutLongGun sc = fromMaybe sc $ do
|
||||
curzoom <- sc ^? scopeZoom
|
||||
guard $ curzoom > 0.5
|
||||
return $ sc & scopePos %~ (\p -> p +.+ (zoomSpeed - 1) / curzoom *.* p)
|
||||
& scopeZoom *~ zoomSpeed
|
||||
|
||||
ifConfigWallRotate :: Configuration -> World -> World
|
||||
ifConfigWallRotate cfig w
|
||||
|
||||
Reference in New Issue
Block a user