Tweak muzzle flare

This commit is contained in:
2023-05-28 11:14:05 +01:00
parent 10c9e2261f
commit 4b35a683af
6 changed files with 18 additions and 20 deletions
+6 -4
View File
@@ -16,16 +16,17 @@ module Dodge.WorldEvent.Flash (
import Dodge.Data.World
import Dodge.LightSource
--import Dodge.Default
import Control.Monad
import Geometry
import LensHelp
import Picture
import System.Random
import Control.Monad.Trans.State.Strict
muzFlareAt :: Color -> Point3 -> Float -> World -> World
muzFlareAt col tranv dir w =
w & cWorld . lWorld . flares
w & randGen .~ g
& cWorld . lWorld . flares
.:~ MuzFlare
{ _flarePoly =
map
@@ -39,7 +40,8 @@ muzFlareAt col tranv dir w =
, _flareTime = 2
}
where
(a : b : c : d : _) = randomRs (2, 20) (_randGen w)
thestate = replicateM 4 $ state $ randomR (2,20)
((a : b : c : d : _), g) = runState thestate $ _randGen w -- randomRs (2, 20) (_randGen w)
flareCircleAt :: Color -> Float -> Point3 -> World -> World
flareCircleAt col alphax tranv =