Files
loop/src/Dodge/Distortion.hs
T
2022-07-27 12:49:23 +01:00

11 lines
330 B
Haskell

module Dodge.Distortion where
import Dodge.Data.Distortion
updateDistortion :: Distortion -> Maybe Distortion
updateDistortion dt = case dt of
RadialDistortion a b c v
| v > 1 -> Just $ RadialDistortion a b c $ max 1 (v - 0.05)
| v < 1 -> Just $ RadialDistortion a b c $ min 1 (v + 0.05)
| otherwise -> Nothing