Reify shockwaves

This commit is contained in:
2022-07-24 00:20:28 +01:00
parent 97174535d8
commit 5b9e9968f3
17 changed files with 197 additions and 166 deletions
-23
View File
@@ -1,23 +0,0 @@
{- |
Particles and pictures that decorate weapons, such as laser scopes etc.
-}
module Dodge.Item.Weapon.Decoration
( makeLaserScope
) where
import Dodge.Data
import Geometry.Data
import Picture
import Control.Lens
makeLaserScope
:: Point2 -- ^ Start point
-> Point2 -- ^ End point
-> Float -- ^ Fraction of red/green
-> Particle
makeLaserScope p ep relFrac = PtTargetLaser
{_ptUpdate = \w pt -> (w, Just $ pt & ptUpdate .~ \w' _ -> (w',Nothing))
, _ptPoints = [p,ep]
, _ptColor = col
}
where
col = mixColors relFrac (1-relFrac) red green
+6 -4
View File
@@ -141,10 +141,12 @@ targetLaserUpdate _ cr w t
(mp, ps) = reflectLaserAlong 0.2 sp ep w
sp = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
ep = sp +.+ 5000 *.* normalizeV (mouseWorldPos w -.- sp)
addLaserPic = instantParticles .:~ PtTargetLaser
{ _ptUpdate = ptSimpleTime 1
, _ptPoints = sp:ps
, _ptColor = col
addLaserPic = lasers .:~ LaserStart
{ _lpPhaseV = 1
, _lpDir = _crDir cr
, _lpPos = sp
, _lpColor = col
, _lpType = TargetLaser
}
--wpammo = _itConsumption it
-- reloadFrac