Refactor, try to limit dependencies
This commit is contained in:
+7
-19
@@ -1,26 +1,14 @@
|
||||
module Dodge.Laser.Draw
|
||||
where
|
||||
module Dodge.Laser.Draw where
|
||||
|
||||
import Dodge.Data.Laser
|
||||
import Picture
|
||||
|
||||
--drawLaser :: Particle -> Picture
|
||||
----drawLaser pt = setLayer BloomNoZWrite $ pictures
|
||||
-- --[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
|
||||
--drawLaser pt =
|
||||
-- setLayer BloomNoZWrite $ pictures
|
||||
---- [ setDepth 19 . color (brightX 1 0.5 col) $ thickLine 20 ps
|
||||
-- [ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
|
||||
-- ]
|
||||
-- where
|
||||
-- col = _ptColor pt
|
||||
-- ps = _ptPoints pt
|
||||
|
||||
|
||||
drawLaser :: Laser -> Picture
|
||||
drawLaser pt =
|
||||
setLayer BloomNoZWrite $ pictures
|
||||
[ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
|
||||
]
|
||||
setLayer BloomNoZWrite $
|
||||
pictures
|
||||
[ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
|
||||
]
|
||||
where
|
||||
col = _laColor pt
|
||||
ps = _laPoints pt
|
||||
ps = _laPoints pt
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
module Dodge.Laser.Update
|
||||
where
|
||||
import Dodge.Item.Weapon.LaserPath
|
||||
import Dodge.WorldEvent.Damage
|
||||
import Dodge.Data
|
||||
import Geometry
|
||||
module Dodge.Laser.Update where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Data.World
|
||||
import Dodge.Item.Weapon.LaserPath
|
||||
import Dodge.WorldEvent.Damage
|
||||
import Geometry
|
||||
|
||||
updateLaser :: World -> LaserStart -> (World, Laser)
|
||||
updateLaser w pt =
|
||||
( w'
|
||||
, Laser {_laPoints = sp:ps , _laColor = _lpColor pt, _laType = _lpType pt}
|
||||
, Laser{_laPoints = sp : ps, _laColor = _lpColor pt, _laType = _lpType pt}
|
||||
)
|
||||
where
|
||||
w' = fromMaybe w $ do
|
||||
dam <- pt ^? lpType . laserTypeDamage
|
||||
return $ damThingHitWith (\p1 p2 p3 -> Damage LASERING dam p1 p2 p3 NoDamageEffect) sp xp thHit w
|
||||
phasev = _lpPhaseV pt
|
||||
sp = _lpPos pt
|
||||
sp = _lpPos pt
|
||||
dir = _lpDir pt
|
||||
xp = sp +.+ 800 *.* unitVectorAtAngle dir
|
||||
(thHit, ps) = reflectLaserAlong phasev sp xp w
|
||||
|
||||
|
||||
Reference in New Issue
Block a user