Reify shockwaves
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user