Generalise flame flicker, cleanup

This commit is contained in:
2021-10-31 14:18:57 +00:00
parent 49db8f804e
commit c443cc4372
3 changed files with 37 additions and 104 deletions
+5 -2
View File
@@ -13,6 +13,7 @@ import Geometry.Data
import Picture
import Control.Lens
import System.Random
makeCloudAt
:: (Cloud -> Picture) -- ^ draw function
@@ -64,8 +65,10 @@ makeStartCloudAt = makeCloudAt (drawCloudWith 2 800 white) 10 400 5
shellTrailCloud :: Point3 -> World -> World
shellTrailCloud = makeCloudAt (drawCloudWith (4/3) 800 (greyN 0.5)) 15 400 40
makeFlamerSmokeAt :: Float -> Point3 -> World -> World
makeFlamerSmokeAt x = makeCloudAt (drawCloudWith 4 300 (greyN x)) 6 200 40
makeFlamerSmokeAt :: Point3 -> World -> World
makeFlamerSmokeAt p w = makeCloudAt (drawCloudWith 4 300 (greyN x)) 6 200 40 p w
where
x = fst $ randomR (0.5,0.8) (_randGen w)
spawnSmokeAtCursor :: World -> World
spawnSmokeAtCursor w = shellTrailCloud (V3 x y 20) w