Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -11,22 +11,16 @@ import LensHelp
|
||||
import Picture
|
||||
import RandomHelp
|
||||
|
||||
--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
|
||||
& cWorld . energyBalls .:~ thepart
|
||||
& cWorld . lWorld . energyBalls .:~ thepart
|
||||
& randGen .~ g
|
||||
where
|
||||
(thepart, g) = runState (f p) (_randGen w)
|
||||
|
||||
makeStaticBall :: Point2 -> World -> World
|
||||
makeStaticBall p = randEnergyBallAt aStaticBall p . (cWorld . posEvents .:~ thesparker)
|
||||
makeStaticBall p = randEnergyBallAt aStaticBall p . (cWorld . lWorld . posEvents .:~ thesparker)
|
||||
where
|
||||
thesparker = PosEvent SparkSpawner 10 p
|
||||
|
||||
@@ -92,7 +86,7 @@ makeGasCloud ::
|
||||
World
|
||||
makeGasCloud pos vel w =
|
||||
w
|
||||
& cWorld . clouds .:~ theCloud
|
||||
& cWorld . lWorld . clouds .:~ theCloud
|
||||
& randGen .~ g
|
||||
where
|
||||
theCloud =
|
||||
|
||||
Reference in New Issue
Block a user