Separate out concrete part of world

This commit is contained in:
2022-07-25 12:10:50 +01:00
parent 3354d108be
commit b2efbd2b3e
134 changed files with 933 additions and 930 deletions
+3 -4
View File
@@ -19,13 +19,13 @@ import LensHelp
-- (thepart,g) = runState (f p) (_randGen w)
randEnergyBallAt :: (Point2 -> State StdGen EnergyBall) -> Point2 -> World -> World
randEnergyBallAt f p w = w
& energyBalls .:~ thepart
& cWorld . energyBalls .:~ thepart
& randGen .~ g
where
(thepart,g) = runState (f p) (_randGen w)
makeStaticBall :: Point2 -> World -> World
makeStaticBall p = randEnergyBallAt aStaticBall p . (posEvents .:~ thesparker)
makeStaticBall p = randEnergyBallAt aStaticBall p . (cWorld . posEvents .:~ thesparker)
where
thesparker = PosEvent SparkSpawner 10 p
@@ -84,8 +84,7 @@ makeGasCloud
-> World
-> World
makeGasCloud pos vel w = w
& clouds .:~ theCloud
-- & clouds %~ S.cons theCloud
& cWorld . clouds .:~ theCloud
& randGen .~ g
where
theCloud = Cloud