Separate out concrete part of world
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user