Fix aiming with no weapon crash

This commit is contained in:
2022-02-08 12:47:58 +00:00
parent 9ead5b3979
commit 0a860e6f68
39 changed files with 317 additions and 244 deletions
+8 -10
View File
@@ -48,13 +48,11 @@ muzFlareAt col tranv dir w = w & instantParticles .:~ theFlare
(a:b:c:d:_) = randomRs (2,20) (_randGen w)
flareCircleAt :: Color -> Float -> Point3 -> World -> World
flareCircleAt col alphax tranv = particles .:~ theFlareCircle
where
theFlareCircle = Particle
{ _ptDraw = const . setLayer 1 . translate3 tranv
$ circleSolidCol (withAlpha alphax col) (withAlpha 0 col) 30
, _ptUpdate = ptSimpleTime 1
}
flareCircleAt col alphax tranv = particles .:~ Particle
{ _ptDraw = const . setLayer 1 . translate3 tranv
$ circleSolidCol (withAlpha alphax col) (withAlpha 0 col) 30
, _ptUpdate = ptSimpleTime 1
}
explosionFlashAt :: Point2 -> World -> World
explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 intensityFunc (addZ 20 p)
@@ -65,8 +63,8 @@ explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 intensityFunc
flameFlicker :: Particle -> World -> World
flameFlicker pt
| _btTimer' pt `mod` 5 == 0 = tempLightSources .:~ theLight
| _ptTimer pt `mod` 5 == 0 = tempLightSources
.:~ tlsTimeRadColPos 1 70 (V3 0.5 0 0) (V3 x y 10)
| otherwise = id
where
V2 x y = _btPos' pt
theLight = tlsTimeRadColPos 1 70 (V3 0.5 0 0) (V3 x y 10)
V2 x y = _ptPos pt