Move radar blips into own grouping, work on data-ifying particles
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
|
||||
drawBlip :: RadarBlip -> Picture
|
||||
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
|
||||
r = _rbRad pt
|
||||
col = _rbColor pt
|
||||
maxt = _rbMaxTime pt
|
||||
Reference in New Issue
Block a user