Refactor beams

This commit is contained in:
2022-07-21 00:32:29 +01:00
parent 39117b4dfe
commit e2ccf7296a
10 changed files with 94 additions and 54 deletions
+17
View File
@@ -0,0 +1,17 @@
module Dodge.Beam.Draw where
import Dodge.Data.Beam
import Picture
drawBeam :: BeamDraw -> Beam -> Picture
drawBeam bd = case bd of
BasicBeamDraw -> basicDrawBeam
BeamDrawColor _ -> basicDrawBeam
basicDrawBeam :: Beam -> Picture
basicDrawBeam bm = setLayer BloomNoZWrite $ pictures
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
, setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
]
where
col = _bmColor bm
ps = _bmFirstPoints bm