Cleanup, fix menu lock on restarting level after game over

This commit is contained in:
2021-12-06 23:44:10 +00:00
parent 19540bd19e
commit 763b771928
18 changed files with 88 additions and 119 deletions
+23 -1
View File
@@ -1,6 +1,7 @@
module Dodge.Particle.Spark
( colSpark
, colSpark'
, createBarrelSpark
)
where
import Dodge.Data
@@ -9,10 +10,31 @@ import Dodge.Particle.Bullet.Update
import Dodge.WorldEvent.HitEffect
import Color
import Geometry
import LensHelp
import System.Random
import Control.Lens
--import Control.Lens
createBarrelSpark :: Point2 -> Float -> Maybe Int -> Int -> Int -> World -> World
createBarrelSpark pos dir maycid time colid w = w
& instantParticles .:~ spark
where
spark = BulletPt
{ _ptDraw = drawBul
, _ptUpdate = mvBullet
, _btVel' = rotateV dir (V2 5 0)
, _btDrag = 0.9
, _btColor' = numColor colid
, _btTrail' = [pos]
, _btPassThrough' = maycid
, _btWidth' = 1
, _btTimer' = time
, _btHitEffect' = destroyOnImpact sparkEff noEff
}
sparkEff bt p cr = creatures . ix (_crID cr) . crState . crDamage .:~ SparkDam 1 sp p ep
where
sp = head (_btTrail' bt)
ep = sp +.+ _btVel' bt
colSpark :: Int -> Color -> Point2 -> Float -> World -> World
colSpark = colSpark' 0.7
colSpark' :: Float -> Int -> Color -> Point2 -> Float -> World -> World