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
+3 -12
View File
@@ -188,7 +188,7 @@ dualBeam = lasGun
, _lasColor2 = green
, _lasCycle = 0
, _lasDamage = 11
, _lasBeam = BeamCombine lasBeamCombine
, _lasBeam = BeamCombine LasBeamCombine
, _subParams = Nothing
, _dbGap = 20
}
@@ -356,18 +356,9 @@ shootDualLaser it cr w = w'
phasev = _phaseV . _itParams $ _crInv cr IM.! crSel cr
dam = _lasDamage $ _itParams it
drawBeam :: Beam -> Picture
drawBeam 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
basicBeamAt :: Int -> World -> Color -> Int -> Float -> Point2 -> Float -> Beam
basicBeamAt itid w col dam phasev pos dir = Beam
{ _bmDraw = drawBeam
{ _bmDraw = BasicBeamDraw --drawBeam
, _bmPos = pos
, _bmDir = dir
, _bmDamage = dam
@@ -377,7 +368,7 @@ basicBeamAt itid w col dam phasev pos dir = Beam
, _bmPoints = pos:ps
, _bmFirstPoints = []
, _bmOrigin = Just itid
, _bmType = BeamCombine $ const id
, _bmType = BeamCombine NoBeamCombine
}
where
(_,ps) = reflectLaserAlong phasev pos (pos +.+ 800 *.* unitVectorAtAngle dir) w