Add intersecting beams
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
module Dodge.Particle.Damage where
|
||||
import Dodge.Data
|
||||
import Geometry
|
||||
import LensHelp
|
||||
|
||||
import System.Random
|
||||
import Control.Monad.State
|
||||
|
||||
-- TODO unify particle position in a sensible manner
|
||||
spawnAtBulDams :: (Point2 -> State StdGen Particle)
|
||||
-> Particle -> Point2 -> [Damage]
|
||||
spawnAtBulDams thespawn bt p =
|
||||
@@ -21,7 +23,9 @@ simpleDam dt amount bt p =
|
||||
[ Damage dt amount sp p ep NoDamageEffect
|
||||
]
|
||||
where
|
||||
sp = head $ _ptTrail bt
|
||||
sp = case bt ^? ptTrail of
|
||||
Nothing -> _ptPos bt
|
||||
Just xs -> head xs
|
||||
bulVel = _ptVel bt
|
||||
ep = sp +.+ bulVel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user