Move radar blips into own grouping, work on data-ifying particles

This commit is contained in:
2022-07-10 12:38:32 +01:00
parent ce5b596d4f
commit 23022d85a1
10 changed files with 290 additions and 32 deletions
+23
View File
@@ -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