Separate and reify laser beams

This commit is contained in:
2022-07-23 23:26:39 +01:00
parent 262ac237cd
commit 7563441154
13 changed files with 102 additions and 72 deletions
+5 -9
View File
@@ -77,7 +77,9 @@ module Dodge.Data
, module Dodge.Data.Projectile
, module Dodge.Data.Modification
, module Dodge.Data.PressPlate
, module Dodge.Data.Laser
) where
import Dodge.Data.Laser
import Dodge.Data.PressPlate
import Dodge.Data.Modification
import Dodge.Data.Projectile
@@ -220,6 +222,8 @@ data World = World
, _flares :: [Flare]
, _newBeams :: WorldBeams
, _beams :: WorldBeams
, _lasers :: [LaserStart]
, _lasersToDraw :: [Laser]
, _walls :: IM.IntMap Wall
, _wallDamages :: IM.IntMap [Damage]
, _doors :: IM.IntMap Door
@@ -370,15 +374,7 @@ data WorldBeams = WorldBeams
{- Objects without ids.
Update themselves, perhaps with side effects. -}
data Particle
= LaserParticle
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptRange :: Float
, _ptDamage :: Int
, _ptColor :: Color
, _ptPhaseV :: Float
, _ptPoints :: [Point2]
}
| PtTeslaArc
= PtTeslaArc
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptPoints :: [Point2]
, _ptTimer :: Int