Cleanup bullet damage

This commit is contained in:
2021-11-01 17:20:25 +00:00
parent e4c73b9b8b
commit 0dcb1d2c07
3 changed files with 28 additions and 15 deletions
+1 -2
View File
@@ -9,6 +9,7 @@ import Dodge.Data
import Dodge.Data.DamageType
import Dodge.WorldEvent.SpawnParticle
import Dodge.WorldEvent.Cloud
import Dodge.Wall.Reflect
import Geometry
import Geometry.Vector3D
import Color
@@ -41,8 +42,6 @@ wallEff dt wl = case dt of
pSparkCol = brightX 100 1.5 white
lSparkCol = V4 20 (-5) 0 1
reflDirWall :: Point2 -> Point2 -> Wall -> Float
reflDirWall sp ep wl = argV (reflectIn (uncurry (-.-) (_wlLine wl)) (ep -.- sp))
damageBlockWith :: DamageType -> Block -> Block
damageBlockWith dt = case dt of
+11
View File
@@ -0,0 +1,11 @@
module Dodge.Wall.Reflect
where
import Geometry
import Dodge.Data
reflDirWall :: Point2 -> Point2 -> Wall -> Float
reflDirWall sp ep wl = argV (reflectIn (uncurry (-.-) (_wlLine wl)) (ep -.- sp))
-- point free nonsense
reflVelWall :: Wall -> Point2 -> Point2
reflVelWall = reflectIn . uncurry (-.-) . _wlLine