Refactor basic explosion
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.WorldEvent.Flash
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Base
|
||||
import Dodge.LightSources
|
||||
|
||||
import Dodge.WorldEvent.ThingsHit
|
||||
import Dodge.WorldEvent.HelperParticle
|
||||
@@ -95,7 +96,12 @@ lowLightWidthAt :: Float -> Float -> Color -> Float -> Int -> Float -> Point2 ->
|
||||
lowLightWidthAt len wdth col alphay rays rad p w = foldr (lowLightWidthHit len wdth col alphay p) w ps
|
||||
where ps = map ((+.+) p) $ nRaysRad rays rad
|
||||
|
||||
explosionFlashAt = lowLightWidthAt 10 5 white 0.3 75 150
|
||||
explosionFlashAt :: Point2 -> World -> World
|
||||
explosionFlashAt p = over tempLightSources ((:) $ tLightFade 20 150 intensityFunc p)
|
||||
. lowLightWidthAt 10 5 white 0.3 75 150 p
|
||||
where intensityFunc x
|
||||
| x < 10 = 1 / (10 - fromIntegral x)
|
||||
| otherwise = 1
|
||||
|
||||
flameGlareAt = lowLightWidthAt 10 5 orange 0.05 8 50
|
||||
|
||||
@@ -105,11 +111,11 @@ lowLightDirected col alpha a b angles w
|
||||
|
||||
|
||||
muzFlareAt :: Point2 -> World -> World
|
||||
muzFlareAt p = over particles' ((:) (muzzleFlareAt p))
|
||||
. lowLightAt p
|
||||
muzFlareAt p = over particles' ((:) (muzzleFlarePt p))
|
||||
. lowLightWidthAt 10 5 white 0.5 20 30 p
|
||||
|
||||
muzzleFlareAt :: Point2 -> Particle'
|
||||
muzzleFlareAt (x,y) =
|
||||
muzzleFlarePt :: Point2 -> Particle'
|
||||
muzzleFlarePt (x,y) =
|
||||
Particle'
|
||||
{ _ptPict' = setDepth 0
|
||||
. setLayer 1
|
||||
|
||||
Reference in New Issue
Block a user