Refactor, try to limit dependencies
This commit is contained in:
@@ -1,54 +1,15 @@
|
||||
module Dodge.Particle.Draw where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Data.Laser
|
||||
import Picture
|
||||
|
||||
--drawParticle :: Particle -> Picture
|
||||
--drawParticle pt = case pt of
|
||||
-- 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)
|
||||
|
||||
--drawInverseShockwave :: Particle -> Picture
|
||||
--drawInverseShockwave pt
|
||||
-- = setLayer BloomLayer $ setDepth 20 $ uncurryV translate p
|
||||
-- $ color cyan $ thickCircle rad thickness
|
||||
-- where
|
||||
-- p = _ptPos pt
|
||||
-- r = _ptRad pt
|
||||
-- t = _ptTimer pt
|
||||
-- rad = r - 0.1 * r * fromIntegral (10 - t)
|
||||
-- thickness = fromIntegral (10 - t) **2 * rad / 40
|
||||
|
||||
--drawTeslaArc :: Particle -> Picture
|
||||
--drawTeslaArc pt = setLayer BloomNoZWrite $ pictures
|
||||
-- [ setDepth 20.5 $ color (brightX 2 1 $ _ptColor pt) $ thickLine 3 ps
|
||||
-- , setDepth 20 $ color (V4 0 0 0 0.5) $ thickLine 10 ps
|
||||
-- ]
|
||||
-- where
|
||||
-- ps = _ptPoints pt
|
||||
|
||||
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)
|
||||
]
|
||||
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)
|
||||
]
|
||||
where
|
||||
col = _laColor pt
|
||||
(sp:ps) = _laPoints pt
|
||||
|
||||
--drawSonicWave :: Particle -> Picture
|
||||
--drawSonicWave pt = foldMap (color (_ptColor pt) . setLayer BloomNoZWrite . setDepth 20
|
||||
-- . lineThick 20
|
||||
-- . map fst)
|
||||
-- $ _ptPointDirs pt
|
||||
|
||||
(sp : ps) = _laPoints pt
|
||||
|
||||
Reference in New Issue
Block a user