Tweak energyballs

This commit is contained in:
2025-06-09 08:40:47 +01:00
parent 3dce133f30
commit 5d8b493636
9 changed files with 12 additions and 126 deletions
+10 -7
View File
@@ -13,6 +13,7 @@ import Data.List (foldl')
import Data.Maybe
import Dodge.Base.Collide
import Dodge.Data.World
import Dodge.SoundLogic
import Dodge.Spark
import Dodge.WorldEvent.ThingsHit
import Geometry
@@ -47,12 +48,14 @@ updateEnergyBall w eb
ebEffect :: EnergyBall -> World -> World
ebEffect eb = case _ebEff eb of
ElectricalBall -> randSparkExtraVel
(_ebVel eb)
ElectricSpark
(state (randomR (3, 6)))
(state (randomR (0, 2 * pi)))
(_ebPos eb)
ElectricalBall ->
soundContinue (EBSound 0) (_ebPos eb) elecCrackleS (Just 2)
. randSparkExtraVel
(_ebVel eb)
ElectricSpark
(state (randomR (3, 6)))
(state (randomR (0, 2 * pi)))
(_ebPos eb)
_ -> id
energyBallAt :: EnergyBallType -> Point2 -> World -> World
@@ -85,7 +88,7 @@ ebFlicker :: EnergyBall -> World -> World
ebFlicker pt
| _ebTimer pt `mod` 7 == 0 =
cWorld . lWorld . lights
.:~ LSParam (addZ 20 $ _ebPos pt) 70 (0.5 * xyzV4 (ebColor pt))
.:~ LSParam (addZ 5 $ _ebPos pt) 70 (0.5 * xyzV4 (ebColor pt))
| otherwise = id
ebColor :: EnergyBall -> Color