This commit is contained in:
2022-07-10 12:51:20 +01:00
parent 23022d85a1
commit 7a1dbbb3f9
13 changed files with 35 additions and 198 deletions
+1 -3
View File
@@ -2,7 +2,6 @@ module Dodge.Particle.Bullet.Spawn
( aBulAt
) where
import Dodge.Data
import Dodge.Particle.Bullet.Draw
import Dodge.Particle.Bullet.Update
import Geometry
import Picture
@@ -23,8 +22,7 @@ aBulAt
-> Float -- ^ Bullet width
-> Particle
aBulAt vfact updatemod mcol maycid pos vel drag hiteff width = BulletPt
{ _ptDraw = drawBul
, _ptUpdate = theupdate
{ _ptUpdate = theupdate
, _ptVel = fromMaybe 1 vfact *.* vel
, _btDrag = drag
, _ptColor = fromMaybe (V4 200 200 200 2) mcol
+3 -8
View File
@@ -6,7 +6,6 @@ module Dodge.Particle.Spark
) where
import Dodge.Data
import Dodge.Particle.HitEffect.ExpireAndDamage
import Dodge.Particle.Bullet.Draw
import Dodge.Particle.Damage
--import Dodge.Particle.Bullet.HitEffect
import Dodge.Particle.Bullet.Update
@@ -21,8 +20,7 @@ import System.Random
-- TODO remove/simplify this function
createBarrelSpark :: Point2 -> Float -> Maybe Int -> Int -> Int -> World -> World
createBarrelSpark pos dir maycid time colid = instantParticles .:~ BulletPt
{ _ptDraw = drawBul
, _ptUpdate = mvBullet
{ _ptUpdate = mvBullet
, _ptVel = rotateV dir (V2 5 0)
, _btDrag = 0.9
, _ptColor = numColor colid
@@ -52,8 +50,7 @@ randColDirTimeSpark randcol randdir randtime pos w = w
t <- randtime
return (c,d,t)
spark = BulletPt
{ _ptDraw = drawBul
, _ptUpdate = mvBullet
{ _ptUpdate = mvBullet
, _btDrag = 0.9
, _ptVel = rotateV dir (V2 5 0)
, _ptColor = col
@@ -72,9 +69,7 @@ colSparkRandDir randDir time col pos baseDir w = w
(a,g) = randomR (-randDir,randDir) $ _randGen w
dir = a + baseDir
spark = BulletPt
{ _ptDraw = drawBul
--{ _ptDraw = const mempty
, _ptUpdate = mvBullet
{ _ptUpdate = mvBullet
, _btDrag = 0.9
, _ptVel = rotateV dir (V2 5 0)
, _ptColor = col
-8
View File
@@ -22,19 +22,11 @@ import LensHelp
aTeslaArcAt :: Color -> [ArcStep] -> Particle
aTeslaArcAt col thearc = PtTeslaArc
{ _ptPoints = map (^. asPos) thearc
, _ptDraw = drawTeslaArc
, _ptUpdate = moveTeslaArc thearc
, _ptTimer = 2
, _ptColor = brightX 100 1.5 col
}
drawTeslaArc :: Particle -> Picture
drawTeslaArc pt = setLayer BloomNoZWrite $ pictures
[ setDepth 20.5 $ color (brightX 2 1 $ _ptColor pt) $ thickLine 3 ps
, setDepth 20 $ color (V4 0 0 0 0.5) $ thickLine 10 ps
]
where
ps = _ptPoints pt
moveTeslaArc :: [ArcStep]
-> World
-> Particle