Cleanup, add spark to bullet turret hit
This commit is contained in:
@@ -11,11 +11,11 @@ import Dodge.Wall.Dust
|
||||
import Dodge.Particle.Spark
|
||||
import Geometry
|
||||
import Color
|
||||
import LensHelp
|
||||
|
||||
import Control.Lens
|
||||
damageWall :: DamageType -> Wall -> World -> World
|
||||
damageWall dt wl = case _wlStructure wl of
|
||||
MachinePart mcid -> machines . ix mcid . mcDamage %~ (dt :)
|
||||
MachinePart mcid -> wallEff dt wl . (machines . ix mcid . mcDamage .:~ dt)
|
||||
BlockPart blid -> wallEff dt wl . (blocks . ix blid %~ damageBlockWith dt)
|
||||
CreaturePart crid f -> f dt wl crid
|
||||
_ -> wallEff dt wl
|
||||
|
||||
@@ -5,7 +5,7 @@ import Geometry
|
||||
import Control.Lens
|
||||
|
||||
wlDustAt :: Wall -> Point2 -> World -> World
|
||||
wlDustAt wl p = smokeCloudAt dustcol 20 200 1 (addZ 20 p)
|
||||
wlDustAt wl = smokeCloudAt dustcol 20 200 1 . addZ 20
|
||||
where
|
||||
dustcol = _wlColor wl & _4 .~ 1
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import Data.Foldable
|
||||
|
||||
zoneOfWall :: Wall -> [(Int,Int)]
|
||||
zoneOfWall wl
|
||||
| uncurry dist wlline <= 2*zoneSize = [zoneOfPoint $ uncurry pHalf wlline ]
|
||||
| uncurry dist wlline <= 2*zoneSize = [zoneOfPoint $ uncurry pHalf wlline ]
|
||||
| otherwise = map zoneOfPoint $ uncurry (divideLine zoneSize) wlline
|
||||
where
|
||||
wlline = _wlLine wl
|
||||
|
||||
Reference in New Issue
Block a user