Refactor beams
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
module Dodge.Data.Item.Params where
|
||||
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Targeting where
|
||||
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
data Targeting
|
||||
= NoTargeting
|
||||
| Targeting
|
||||
{ _tgPos :: Maybe Point2
|
||||
, _tgUpdate :: TargetUpdate --Item -> Creature -> World -> Targeting -> (World, Targeting)
|
||||
, _tgDraw :: TargetDraw --Item -> Creature -> Configuration -> World -> Picture
|
||||
, _tgID :: Maybe Int
|
||||
, _tgActive :: Bool
|
||||
}
|
||||
data TargetUpdate = NoTargetUpdate
|
||||
| TargetLaserUpdate
|
||||
| TargetRBPressUpdate
|
||||
| TargetRBCreatureUpdate
|
||||
| TargetCursorUpdate
|
||||
|
||||
data TargetDraw = NoTargetDraw
|
||||
| TargetDistanceDraw
|
||||
| SimpleDrawTarget
|
||||
| TargetRBCreatureDraw
|
||||
makeLenses ''Targeting
|
||||
|
||||
Reference in New Issue
Block a user