Refactor beams

This commit is contained in:
2022-07-21 00:32:29 +01:00
parent 39117b4dfe
commit e2ccf7296a
10 changed files with 94 additions and 54 deletions
+39
View File
@@ -0,0 +1,39 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Beam where
import Geometry.Data
import Color
import Control.Lens
{- | Linear beams. Last only one frame.
- Can interact with one another in a limited manner
- can probably be moved to a separate file
-}
data Beam = Beam
{ _bmDraw :: BeamDraw -- Beam -> Picture
, _bmPos :: Point2
, _bmDir :: Float
, _bmDamage :: Int
, _bmColor :: Color
, _bmPoints :: [Point2]
, _bmFirstPoints :: [Point2]
, _bmRange :: Float
, _bmPhaseV :: Float
, _bmOrigin :: Maybe Int
, _bmType :: BeamType
}
data BeamDraw = BasicBeamDraw
| BeamDrawColor Color
data BeamCombineType = FlameBeamCombine
| LasBeamCombine
| TeslaBeamCombine
| SplitBeamCombine
| NoBeamCombine
data BeamType
= BeamCombine
{ _beamCombine :: BeamCombineType -- (Point2 , (Point2,Point2,Beam) , (Point2,Point2,Beam)) -> World -> World
}
| BeamSimple
makeLenses ''BeamType
makeLenses ''Beam