Cleanup
This commit is contained in:
+1
-11
@@ -380,17 +380,7 @@ data WorldBeams = WorldBeams
|
|||||||
{- Objects without ids.
|
{- Objects without ids.
|
||||||
Update themselves, perhaps with side effects. -}
|
Update themselves, perhaps with side effects. -}
|
||||||
data Particle
|
data Particle
|
||||||
= PtInvShockwave
|
= ShockLine
|
||||||
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
|
|
||||||
, _ptColor :: Color
|
|
||||||
, _ptPos :: Point2
|
|
||||||
, _ptRad :: Float
|
|
||||||
, _ptDam :: Int
|
|
||||||
, _ptPush :: Float
|
|
||||||
, _ptMaxTime :: Int
|
|
||||||
, _ptTimer :: Int
|
|
||||||
}
|
|
||||||
| ShockLine
|
|
||||||
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
|
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
|
||||||
, _ptPointDirs :: [[(Point2,Float)]]
|
, _ptPointDirs :: [[(Point2,Float)]]
|
||||||
, _ptTimer :: Int
|
, _ptTimer :: Int
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import Dodge.SoundLogic
|
|||||||
import Dodge.Item.Weapon.LaserPath
|
import Dodge.Item.Weapon.LaserPath
|
||||||
--import Dodge.Item.Attachment.Data
|
--import Dodge.Item.Attachment.Data
|
||||||
import Dodge.Creature.Test
|
import Dodge.Creature.Test
|
||||||
import Dodge.WorldEvent.HelperParticle
|
|
||||||
import Picture
|
import Picture
|
||||||
import Geometry.Vector
|
import Geometry.Vector
|
||||||
import LensHelp
|
import LensHelp
|
||||||
@@ -138,7 +137,7 @@ targetLaserUpdate _ cr w t
|
|||||||
& tgActive .~ False
|
& tgActive .~ False
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
(mp, ps) = reflectLaserAlong 0.2 sp ep w
|
(mp, _) = reflectLaserAlong 0.2 sp ep w
|
||||||
sp = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
|
sp = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
|
||||||
ep = sp +.+ 5000 *.* normalizeV (mouseWorldPos w -.- sp)
|
ep = sp +.+ 5000 *.* normalizeV (mouseWorldPos w -.- sp)
|
||||||
addLaserPic = lasers .:~ LaserStart
|
addLaserPic = lasers .:~ LaserStart
|
||||||
|
|||||||
+10
-11
@@ -1,6 +1,5 @@
|
|||||||
module Dodge.Particle.Draw where
|
module Dodge.Particle.Draw where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Geometry
|
|
||||||
import Picture
|
import Picture
|
||||||
|
|
||||||
drawParticle :: Particle -> Picture
|
drawParticle :: Particle -> Picture
|
||||||
@@ -19,16 +18,16 @@ drawParticle pt = case pt of
|
|||||||
-- rad = r - (3/4) * r * tFraction
|
-- rad = r - (3/4) * r * tFraction
|
||||||
-- tFraction = fromIntegral (_ptTimer pt) / fromIntegral (_ptMaxTime pt)
|
-- tFraction = fromIntegral (_ptTimer pt) / fromIntegral (_ptMaxTime pt)
|
||||||
|
|
||||||
drawInverseShockwave :: Particle -> Picture
|
--drawInverseShockwave :: Particle -> Picture
|
||||||
drawInverseShockwave pt
|
--drawInverseShockwave pt
|
||||||
= setLayer BloomLayer $ setDepth 20 $ uncurryV translate p
|
-- = setLayer BloomLayer $ setDepth 20 $ uncurryV translate p
|
||||||
$ color cyan $ thickCircle rad thickness
|
-- $ color cyan $ thickCircle rad thickness
|
||||||
where
|
-- where
|
||||||
p = _ptPos pt
|
-- p = _ptPos pt
|
||||||
r = _ptRad pt
|
-- r = _ptRad pt
|
||||||
t = _ptTimer pt
|
-- t = _ptTimer pt
|
||||||
rad = r - 0.1 * r * fromIntegral (10 - t)
|
-- rad = r - 0.1 * r * fromIntegral (10 - t)
|
||||||
thickness = fromIntegral (10 - t) **2 * rad / 40
|
-- thickness = fromIntegral (10 - t) **2 * rad / 40
|
||||||
|
|
||||||
--drawTeslaArc :: Particle -> Picture
|
--drawTeslaArc :: Particle -> Picture
|
||||||
--drawTeslaArc pt = setLayer BloomNoZWrite $ pictures
|
--drawTeslaArc pt = setLayer BloomNoZWrite $ pictures
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ flicker : potentially long, moving, abrupt changes in alpha
|
|||||||
module Dodge.WorldEvent.Flash
|
module Dodge.WorldEvent.Flash
|
||||||
( explosionFlashAt
|
( explosionFlashAt
|
||||||
, muzFlareAt
|
, muzFlareAt
|
||||||
, ptFlicker
|
|
||||||
, flareCircleAt
|
, flareCircleAt
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
@@ -48,9 +47,3 @@ flareCircleAt col alphax tranv = flares .:~ CircFlare
|
|||||||
|
|
||||||
explosionFlashAt :: Point2 -> World -> World
|
explosionFlashAt :: Point2 -> World -> World
|
||||||
explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 (TLSFade 1 10) (addZ 20 p)
|
explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 (TLSFade 1 10) (addZ 20 p)
|
||||||
|
|
||||||
ptFlicker :: Particle -> World -> World
|
|
||||||
ptFlicker pt
|
|
||||||
| _ptTimer pt `mod` 7 == 0 = tempLightSources
|
|
||||||
.:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ptColor pt)) (addZ 10 $ _ptPos pt)
|
|
||||||
| otherwise = id
|
|
||||||
|
|||||||
@@ -2,16 +2,11 @@ module Dodge.WorldEvent.Shockwave
|
|||||||
( makeShockwaveAt
|
( makeShockwaveAt
|
||||||
, inverseShockwaveAt
|
, inverseShockwaveAt
|
||||||
) where
|
) where
|
||||||
import Dodge.Zoning.Wall
|
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Wall.Damage
|
|
||||||
import Dodge.Base
|
|
||||||
import Geometry
|
import Geometry
|
||||||
import Picture
|
import Picture
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
import Data.Foldable
|
|
||||||
import qualified IntMapHelp as IM
|
|
||||||
-- currently very effective against walls
|
-- currently very effective against walls
|
||||||
makeShockwaveAt
|
makeShockwaveAt
|
||||||
:: [Int] -- ^ IDs of invulnerable creatures.
|
:: [Int] -- ^ IDs of invulnerable creatures.
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ module Dodge.WorldEvent.SpawnParticle
|
|||||||
, randParticleAt
|
, randParticleAt
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.WorldEvent.Shockwave
|
|
||||||
import RandomHelp
|
import RandomHelp
|
||||||
import Picture
|
import Picture
|
||||||
import Geometry
|
import Geometry
|
||||||
|
|||||||
Reference in New Issue
Block a user