Generalise flame flicker, cleanup

This commit is contained in:
2021-10-31 14:18:57 +00:00
parent 49db8f804e
commit c443cc4372
3 changed files with 37 additions and 104 deletions
+14
View File
@@ -14,11 +14,13 @@ module Dodge.WorldEvent.Flash
, laserGunFlashAt
, teslaGunFlashAt
, muzFlareAt
, flameFlicker
)
where
import Dodge.Data
import Dodge.LightSources.Lamp
import Dodge.WorldEvent.HelperParticle
import Dodge.Default
import Picture
import Geometry
@@ -65,3 +67,15 @@ explosionFlashAt p = tempLightSources %~ (tLightTimedIntensity 20 150 intensityF
sparkFlashAt :: Point2 -> World -> World
sparkFlashAt _ = id
flameFlicker :: Particle -> World -> World
flameFlicker pt
| _btTimer' pt `mod` 5 == 0 = tempLightSources %~ (theLight :)
| otherwise = id
where
V2 x y = _btPos' pt
theLight = defaultTLS
{ _tlsPos = V3 x y 10
, _tlsRad = 70
, _tlsIntensity = V3 0.5 0 0
}