Create datatypes for radar sweeps
This commit is contained in:
@@ -11,8 +11,6 @@ drawParticle pt = case pt of
|
||||
PtTargetLaser {} -> drawTargetLaser pt
|
||||
LaserParticle {} -> drawLaser pt
|
||||
ShockLine {} -> drawSonicWave pt
|
||||
RadarCircleParticle {} -> drawPulse pt
|
||||
|
||||
|
||||
drawShockwave :: Particle -> Picture
|
||||
drawShockwave pt = setDepth 20
|
||||
@@ -72,17 +70,3 @@ drawSonicWave pt = foldMap (color (_ptColor pt) . setLayer BloomNoZWrite . setDe
|
||||
. map fst)
|
||||
$ _ptPointDirs pt
|
||||
|
||||
drawPulse :: Particle -> Picture
|
||||
drawPulse pt = setLayer DebugLayer $ pictures sweepPics
|
||||
where
|
||||
col = _ptColor pt
|
||||
p = _ptPos pt
|
||||
r = _ptRad pt
|
||||
sweepPics = [colHelper 0.1 $ uncurryV translate p $ thickCircle r 15
|
||||
,colHelper 0.06 $ uncurryV translate p $ thickCircle (r-5) 5
|
||||
,colHelper 0.03 $ uncurryV translate p $ thickCircle (r-10) 5
|
||||
]
|
||||
colHelper y = color (withAlpha (y * globalAlpha) col)
|
||||
globalAlpha | x > 10 = 1
|
||||
| otherwise = fromIntegral x / 10
|
||||
x = _ptTimer pt
|
||||
|
||||
Reference in New Issue
Block a user