Add dust on bullet wall hit
This commit is contained in:
@@ -10,14 +10,14 @@ import Picture
|
||||
import Control.Lens
|
||||
|
||||
makeCloudAt
|
||||
:: Float -- ^ radius
|
||||
:: (Cloud -> Picture) -- ^ draw function
|
||||
-> Float -- ^ radius
|
||||
-> Int -- ^ timer
|
||||
-> Float -- ^ resting altitude
|
||||
-> (Cloud -> Picture) -- ^ draw function
|
||||
-> Point3 -- start position
|
||||
-> World
|
||||
-> World
|
||||
makeCloudAt rad t alt drawFunc p w = w & clouds %~ (theCloud :)
|
||||
makeCloudAt drawFunc rad t alt p w = w & clouds %~ (theCloud :)
|
||||
where
|
||||
theCloud = Cloud
|
||||
{ _clPos = p
|
||||
@@ -30,6 +30,16 @@ makeCloudAt rad t alt drawFunc p w = w & clouds %~ (theCloud :)
|
||||
, _clEffect = const id
|
||||
}
|
||||
|
||||
smokeCloudAt
|
||||
:: Color
|
||||
-> Float -- ^ radius
|
||||
-> Int -- ^ timer
|
||||
-> Float -- ^ resting altitude
|
||||
-> Point3 -- start position
|
||||
-> World
|
||||
-> World
|
||||
smokeCloudAt col = makeCloudAt (drawCloudWith (4/3) 800 col)
|
||||
|
||||
drawCloudWith :: Float -> Float -> Color -> Cloud -> Picture
|
||||
drawCloudWith radMult fadet col cl
|
||||
= setLayer 2
|
||||
@@ -39,23 +49,23 @@ drawCloudWith radMult fadet col cl
|
||||
a = min 1 $ fromIntegral (_clTimer cl) / fadet
|
||||
|
||||
makeThickSmokeAt :: Point3 -> World -> World
|
||||
makeThickSmokeAt = makeCloudAt 3 50 30 (drawCloudWith 4 50 black)
|
||||
makeThickSmokeAt = makeCloudAt (drawCloudWith 4 50 black) 3 50 30
|
||||
|
||||
makeThinSmokeAt :: Point3 -> World -> World
|
||||
makeThinSmokeAt = makeCloudAt 5 400 50 (drawCloudWith 4 400 (withAlpha 0.05 black))
|
||||
makeThinSmokeAt = makeCloudAt (drawCloudWith 4 400 (withAlpha 0.05 black)) 5 400 50
|
||||
|
||||
makeStartCloudAt :: Point3 -> World -> World
|
||||
--makeSmokeCloudAt = makeCloudAt 10 200 (drawCloudWith 2 200 (greyN 0.5))
|
||||
makeStartCloudAt = makeCloudAt 10 400 5 (drawCloudWith 2 800 white)
|
||||
makeStartCloudAt = makeCloudAt (drawCloudWith 2 800 white) 10 400 5
|
||||
|
||||
makeSmokeCloudAt :: Point3 -> World -> World
|
||||
--makeSmokeCloudAt = makeCloudAt 10 200 (drawCloudWith 2 200 (greyN 0.5))
|
||||
makeSmokeCloudAt = makeCloudAt 15 400 40 (drawCloudWith (4/3) 800 (greyN 0.5))
|
||||
shellTrailCloud :: Point3 -> World -> World
|
||||
----makeSmokeCloudAt = makeCloudAt 10 200 (drawCloudWith 2 200 (greyN 0.5))
|
||||
shellTrailCloud = makeCloudAt (drawCloudWith (4/3) 800 (greyN 0.5)) 15 400 40
|
||||
|
||||
makeFlamerSmokeAt :: Float -> Point3 -> World -> World
|
||||
makeFlamerSmokeAt x = makeCloudAt 6 200 40 (drawCloudWith 4 300 (greyN x))
|
||||
makeFlamerSmokeAt x = makeCloudAt (drawCloudWith 4 300 (greyN x)) 6 200 40
|
||||
|
||||
spawnSmokeAtCursor :: World -> World
|
||||
spawnSmokeAtCursor w = makeSmokeCloudAt (V3 x y 20) w
|
||||
spawnSmokeAtCursor w = shellTrailCloud (V3 x y 20) w
|
||||
where
|
||||
V2 x y = mouseWorldPos w
|
||||
|
||||
@@ -85,7 +85,7 @@ flashFlareAt col alphax (V2 x y) = Particle
|
||||
}
|
||||
|
||||
explosionFlashAt :: Point2 -> World -> World
|
||||
explosionFlashAt p = over tempLightSources ((:) $ tLightFade 20 150 intensityFunc p)
|
||||
explosionFlashAt p = over tempLightSources ((:) $ tLightTimedIntensity 20 150 intensityFunc p)
|
||||
where
|
||||
intensityFunc x
|
||||
| x < 10 = 1 / (10 - fromIntegral x)
|
||||
|
||||
Reference in New Issue
Block a user