Improve bullet hit detection

This commit is contained in:
2026-04-13 20:26:34 +01:00
parent b8bec2c830
commit 431e64fbfb
8 changed files with 59 additions and 17 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ slimeCrit :: Creature
slimeCrit = defaultCreature
& crName .~ "slimeCrit"
& crHP .~ HP 1000
& crType .~ SlimeCrit 40 0 (V2 50 0) False True
& crType .~ SlimeCrit 40 0 0 (V2 50 0) False True
& crFaction .~ ColorFaction (light green)
& crPerception . cpVision . viFOV .~ FloatFOV pi
& crActionPlan .~ SlimeIntelligence
+1 -2
View File
@@ -3,7 +3,6 @@
module Dodge.Creature.Update (updateCreature) where
import Dodge.WorldEvent.ThingsHit
import Dodge.Creature.Radius
import Color
import Control.Monad
import qualified IntMapHelp as IM
@@ -112,7 +111,7 @@ slimeCritUpdate cid w
| otherwise = id
v = (s * r) *^ unitVectorAtAngle (cr ^. crDir)
--r = crRad (cr ^. crType)
r = (cr ^?! crType . slimeRad)
r = cr ^?! crType . slimeRad
p = cr ^?! crType . slimeCompression
(p',f')
| dot p v > 0 && dot p v > dot p (vNormal v) && dot p v > dot p (-vNormal v) = (p, id)