This commit is contained in:
2022-07-24 13:53:35 +01:00
parent ac069d08f6
commit 2c1bc67a51
16 changed files with 185 additions and 199 deletions
-10
View File
@@ -1,10 +0,0 @@
{- Helper functions for particles. -}
module Dodge.WorldEvent.HelperParticle
( ptSimpleTime
) where
import Dodge.Data
{- A simple timer update for particles. -}
ptSimpleTime :: Int -> World -> Particle -> (World, Maybe Particle)
ptSimpleTime 0 w _ = (w, Nothing)
ptSimpleTime n w pt = (w, Just $ pt {_ptUpdate = ptSimpleTime (n-1)})
+7 -7
View File
@@ -3,7 +3,7 @@ module Dodge.WorldEvent.SpawnParticle
( makeGasCloud
, makeStaticBall
, concBall
, randParticleAt
-- , randParticleAt
) where
import Dodge.Data
import RandomHelp
@@ -11,12 +11,12 @@ import Picture
import Geometry
import LensHelp
randParticleAt :: (Point2 -> State StdGen Particle) -> Point2 -> World -> World
randParticleAt f p w = w
& instantParticles .:~ thepart
& randGen .~ g
where
(thepart,g) = runState (f p) (_randGen w)
--randParticleAt :: (Point2 -> State StdGen Particle) -> Point2 -> World -> World
--randParticleAt f p w = w
-- & instantParticles .:~ thepart
-- & randGen .~ g
-- where
-- (thepart,g) = runState (f p) (_randGen w)
randEnergyBallAt :: (Point2 -> State StdGen EnergyBall) -> Point2 -> World -> World
randEnergyBallAt f p w = w
& energyBalls .:~ thepart