Add z level to energy balls

This commit is contained in:
2025-08-04 22:49:36 +01:00
parent bde0fa2a5c
commit 09428f2707
14 changed files with 125 additions and 110 deletions
+6 -3
View File
@@ -14,15 +14,16 @@ import Dodge.SoundLogic
import Dodge.WorldEvent.Explosion
import Geometry.Data
import LensHelp
import Linear.V3
usePayload :: Payload -> Point2 -> Point2 -> World -> World
usePayload :: Payload -> Point3 -> Point3 -> World -> World
usePayload = \case
ExplosionPayload -> makeExplosionAt
ShrapnelBomb -> makeShrapnelAt
DudPayload -> const (const id)
makeShrapnelAt :: Point2 -> Point2 -> World -> World
makeShrapnelAt p v w =
makeShrapnelAt :: Point3 -> Point3 -> World -> World
makeShrapnelAt p' vel' w =
w
& soundMultiFrom [Explosion 0, Explosion 1] p bangS Nothing
& cWorld . lWorld . worldEvents
@@ -30,6 +31,8 @@ makeShrapnelAt p v w =
& makeShockwaveAt [] p 50 5 0 white
& cWorld . lWorld . bullets .++~ buls
where
p = p' ^. _xy
v = vel' ^. _xy
vs = replicateM 75 (randInCirc 10) & evalState $ _randGen w
drags :: [Float]
drags = replicateM 75 (state $ randomR (0.85,0.9)) & evalState $ _randGen w