Add extra flare to laser
This commit is contained in:
@@ -59,8 +59,8 @@ makeFlameExplosionAt
|
||||
-> World
|
||||
-> World
|
||||
makeFlameExplosionAt p w
|
||||
= soundMultiFrom [Explosion 0,Explosion 1] p bangS Nothing
|
||||
$ over particles (newFlames ++ ) w
|
||||
= soundMultiFrom [Explosion 0,Explosion 1] p bangS Nothing w
|
||||
& instantParticles .++~ newFlames
|
||||
where
|
||||
newFlames = zipWith makeFlameWithVelAndTime velocities timers
|
||||
makeFlameWithVelAndTime vel time = aFlameParticle time p vel Nothing
|
||||
|
||||
@@ -10,10 +10,9 @@ flicker : potentially long, moving, abrupt changes in alpha
|
||||
-}
|
||||
module Dodge.WorldEvent.Flash
|
||||
( explosionFlashAt
|
||||
, laserGunFlashAt
|
||||
, teslaGunFlashAt
|
||||
, muzFlareAt
|
||||
, ptFlicker
|
||||
, flareCircleAt
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.LightSource
|
||||
@@ -25,14 +24,6 @@ import LensHelp
|
||||
|
||||
import System.Random
|
||||
|
||||
{- Cyan flash. -}
|
||||
teslaGunFlashAt :: Point3 -> World -> World
|
||||
teslaGunFlashAt = flareCircleAt cyan 0.7
|
||||
|
||||
{- Yellow flash. -}
|
||||
laserGunFlashAt :: Point3 -> World -> World
|
||||
laserGunFlashAt = flareCircleAt yellow 0.2
|
||||
|
||||
muzFlareAt :: Color -> Point3 -> Float -> World -> World
|
||||
muzFlareAt col tranv dir w = w & instantParticles .:~ theFlare
|
||||
where
|
||||
@@ -48,9 +39,9 @@ muzFlareAt col tranv dir w = w & instantParticles .:~ theFlare
|
||||
(a:b:c:d:_) = randomRs (2,20) (_randGen w)
|
||||
|
||||
flareCircleAt :: Color -> Float -> Point3 -> World -> World
|
||||
flareCircleAt col alphax tranv = particles .:~ Particle
|
||||
flareCircleAt col alphax tranv = instantParticles .:~ Particle
|
||||
{ _ptDraw = const . setLayer 1 . translate3 tranv
|
||||
$ circleSolidCol (withAlpha alphax col) (withAlpha 0 col) 30
|
||||
$ circleSolidCol (withAlpha 0 0) (withAlpha alphax col) 30
|
||||
, _ptUpdate = ptSimpleTime 1
|
||||
}
|
||||
|
||||
@@ -66,4 +57,3 @@ ptFlicker pt
|
||||
| _ptTimer pt `mod` 7 == 0 = tempLightSources
|
||||
.:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ptColor pt)) (addZ 10 $ _ptPos pt)
|
||||
| otherwise = id
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ inverseShockwaveAt
|
||||
-> Float -- Push amount
|
||||
-> World
|
||||
-> World
|
||||
inverseShockwaveAt p rad dam push = particles .:~ Shockwave
|
||||
inverseShockwaveAt p rad dam push = instantParticles .:~ Shockwave
|
||||
{ _ptDraw = drawInverseShockwave
|
||||
, _ptUpdate = moveInverseShockwave
|
||||
, _ptColor = cyan
|
||||
|
||||
Reference in New Issue
Block a user