Start work on lasguns

This commit is contained in:
2022-07-06 22:24:02 +01:00
parent d63495e335
commit 0eb2fdc37e
9 changed files with 38 additions and 34 deletions
+10 -7
View File
@@ -65,10 +65,10 @@ mvLaser :: Float -- ^ Phase velocity, controls deflection through windows
-> World
-> Particle
-> (World, Maybe Particle)
mvLaser phasev sp dir w pt
= ( damThingHitWith (\p1 p2 p3 -> Damage LASERING dam p1 p2 p3 NoDamageEffect) sp xp thHit w
, Just pt {_ptPoints = sp:ps ,_ptUpdate = ptSimpleTime 0 }
)
mvLaser phasev sp dir w pt =
( damThingHitWith (\p1 p2 p3 -> Damage LASERING dam p1 p2 p3 NoDamageEffect) sp xp thHit w
, Just pt {_ptPoints = sp:ps ,_ptUpdate = ptSimpleTime 0 }
)
where
dam = _ptDamage pt
xp = sp +.+ 800 *.* unitVectorAtAngle dir
@@ -76,9 +76,12 @@ mvLaser phasev sp dir w pt
(thHit, ps) = reflectLaserAlong phasev sp xp w
drawLaser :: Particle -> Picture
drawLaser pt = 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
--drawLaser pt = setLayer BloomNoZWrite $ pictures
--[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
drawLaser pt =
setLayer BloomNoZWrite $ pictures
-- [ setDepth 19 . color (brightX 1 0.5 col) $ thickLine 20 ps
[ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
]
where
col = _ptColor pt