Start using streaming as the way to consume foldable objects
This commit is contained in:
@@ -31,7 +31,7 @@ makePoisonExplosionAt
|
||||
-> World
|
||||
makePoisonExplosionAt p w
|
||||
= soundMultiFrom [Explosion 0,Explosion 1] p bangS Nothing
|
||||
$ foldr (makeGasCloud p) w
|
||||
$ foldl' (flip $ makeGasCloud p) w
|
||||
$ replicateM 25 (randInCirc 2) & evalState $ _randGen w
|
||||
-- just change the number after replicateM to get more or less clouds
|
||||
-- suggested change: use random positions, offset from p, rather than velocities
|
||||
@@ -89,7 +89,7 @@ makeExplosionAt p w = w
|
||||
times = randomRs (15,20) $ _randGen w
|
||||
mF q z v size time = makeFlamelet q z v Nothing size time
|
||||
newFs = zipWith5 mF fPs zs (fmap (3 *.*) fVs') sizes times
|
||||
addFlames w' = foldr ($) w' newFs
|
||||
addFlames w' = foldl' (flip ($)) w' newFs
|
||||
--pushAgainstWalls q = maybe q (uncurry (+.+)) $ reflectPointWalls p q wls
|
||||
pushAgainstWalls q = maybe q fst $ reflectPointWalls p q wls
|
||||
wls = wallsNearPoint p w
|
||||
|
||||
Reference in New Issue
Block a user