Reify shockwaves
This commit is contained in:
+18
-21
@@ -5,22 +5,19 @@ import Picture
|
||||
|
||||
drawParticle :: Particle -> Picture
|
||||
drawParticle pt = case pt of
|
||||
Shockwave {} -> drawShockwave pt
|
||||
PtInvShockwave {} -> drawInverseShockwave pt
|
||||
PtTargetLaser {} -> drawTargetLaser pt
|
||||
ShockLine {} -> drawSonicWave pt
|
||||
|
||||
drawShockwave :: Particle -> Picture
|
||||
drawShockwave pt = setDepth 20
|
||||
. setLayer BloomLayer
|
||||
. uncurryV translate (_ptPos pt)
|
||||
. color (_ptColor pt)
|
||||
$ thickCircle rad thickness
|
||||
where
|
||||
r = _ptRad pt
|
||||
thickness = tFraction**2 * r
|
||||
rad = r - (3/4) * r * tFraction
|
||||
tFraction = fromIntegral (_ptTimer pt) / fromIntegral (_ptMaxTime pt)
|
||||
--
|
||||
--drawShockwave :: Particle -> Picture
|
||||
--drawShockwave pt = setDepth 20
|
||||
-- . setLayer BloomLayer
|
||||
-- . uncurryV translate (_ptPos pt)
|
||||
-- . color (_ptColor pt)
|
||||
-- $ thickCircle rad thickness
|
||||
-- where
|
||||
-- r = _ptRad pt
|
||||
-- thickness = tFraction**2 * r
|
||||
-- rad = r - (3/4) * r * tFraction
|
||||
-- tFraction = fromIntegral (_ptTimer pt) / fromIntegral (_ptMaxTime pt)
|
||||
|
||||
drawInverseShockwave :: Particle -> Picture
|
||||
drawInverseShockwave pt
|
||||
@@ -41,14 +38,14 @@ drawInverseShockwave pt
|
||||
-- where
|
||||
-- ps = _ptPoints pt
|
||||
|
||||
drawTargetLaser :: Particle -> Picture
|
||||
drawTargetLaser :: Laser -> Picture
|
||||
drawTargetLaser pt = setLayer BloomNoZWrite $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 5 (sp:ps)
|
||||
, setDepth 19.5 . color (brightX 5 1 col) $ thickLine 1 (sp:ps)
|
||||
]
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 5 (sp:ps)
|
||||
, setDepth 19.5 . color (brightX 5 1 col) $ thickLine 1 (sp:ps)
|
||||
]
|
||||
where
|
||||
col = _ptColor pt
|
||||
(sp:ps) = _ptPoints pt
|
||||
col = _laColor pt
|
||||
(sp:ps) = _laPoints pt
|
||||
|
||||
drawSonicWave :: Particle -> Picture
|
||||
drawSonicWave pt = foldMap (color (_ptColor pt) . setLayer BloomNoZWrite . setDepth 20
|
||||
|
||||
Reference in New Issue
Block a user