Move radar blips into own grouping, work on data-ifying particles

This commit is contained in:
2022-07-10 12:38:32 +01:00
parent ce5b596d4f
commit 23022d85a1
10 changed files with 290 additions and 32 deletions
+25 -24
View File
@@ -635,16 +635,17 @@ data BeamType
{- Objects without ids.
Update themselves, perhaps with side effects. -}
data Particle
= Particle
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)
}
| RadarCircleParticle
-- = Particle
-- { _ptDraw :: Particle -> Picture
-- , _ptUpdate :: World -> Particle -> (World, Maybe Particle)
-- }
= RadarCircleParticle
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptTimer :: Int
, _ptRad :: Float
, _ptPos :: Point2
, _ptColor :: Color
}
| LaserParticle
{ _ptDraw :: Particle -> Picture
@@ -668,13 +669,13 @@ data Particle
, _ptPoints :: [Point2]
, _ptColor :: Color
}
| LinearParticle
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptPoints :: [Point2]
, _ptTimer :: Int
, _ptColor :: Color
}
-- | LinearParticle
-- { _ptDraw :: Particle -> Picture
-- , _ptUpdate :: World -> Particle -> (World, Maybe Particle)
-- , _ptPoints :: [Point2]
-- , _ptTimer :: Int
-- , _ptColor :: Color
-- }
| BulletPt
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)
@@ -739,18 +740,18 @@ data Particle
, _ptAlpha :: Float
, _ptTran3 :: Point3
}
| PtZ
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptVel :: Point2
, _ptColor :: Color
, _ptPos :: Point2
, _ptCrIgnore :: Maybe Int
, _ptWidth :: Float
, _ptTimer :: Int
, _ptHitEff :: HitEffect
, _ptZ :: Float
}
-- | PtZ
-- { _ptDraw :: Particle -> Picture
-- , _ptUpdate :: World -> Particle -> (World, Maybe Particle)
-- , _ptVel :: Point2
-- , _ptColor :: Color
-- , _ptPos :: Point2
-- , _ptCrIgnore :: Maybe Int
-- , _ptWidth :: Float
-- , _ptTimer :: Int
-- , _ptHitEff :: HitEffect
-- , _ptZ :: Float
-- }
| Shockwave
{ _ptDraw :: Particle -> Picture
, _ptUpdate :: World -> Particle -> (World, Maybe Particle)