Refactor, try to limit dependencies
This commit is contained in:
+10
-8
@@ -1,20 +1,22 @@
|
||||
module Dodge.RadarBlip where
|
||||
|
||||
import Dodge.Data.RadarBlip
|
||||
import Geometry.Data
|
||||
import LensHelp
|
||||
import Picture
|
||||
|
||||
updateRadarBlip :: RadarBlip -> Maybe RadarBlip
|
||||
updateRadarBlip rb
|
||||
| _rbTime rb <= 0 = Nothing
|
||||
| otherwise = Just $ rb & rbTime -~ 1
|
||||
updateRadarBlip rb
|
||||
| _rbTime rb <= 0 = Nothing
|
||||
| otherwise = Just $ rb & rbTime -~ 1
|
||||
|
||||
drawBlip :: RadarBlip -> Picture
|
||||
drawBlip pt = setDepth (-0.5)
|
||||
. setLayer DebugLayer
|
||||
. uncurryV translate p
|
||||
. color (withAlpha (fromIntegral t / fromIntegral maxt) col)
|
||||
$ circleSolid r
|
||||
drawBlip pt =
|
||||
setDepth (-0.5)
|
||||
. setLayer DebugLayer
|
||||
. uncurryV translate p
|
||||
. color (withAlpha (fromIntegral t / fromIntegral maxt) col)
|
||||
$ circleSolid r
|
||||
where
|
||||
p = _rbPos pt
|
||||
t = _rbTime pt
|
||||
|
||||
Reference in New Issue
Block a user