Move bullet trajectory into bullet update function

This commit is contained in:
2022-07-17 10:31:34 +01:00
parent c9f7f39f22
commit 7d6407bebc
15 changed files with 159 additions and 121 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ module Dodge.Creature.Damage where
import Dodge.Data
import Dodge.Creature.Test
import Dodge.Particle.Spark
import Dodge.Particle.Bullet.Spawn
import Dodge.Bullet
import Color
import Geometry
import LensHelp
@@ -44,8 +44,8 @@ applyDamageEffect dm de cr w = case de of
& creatures . ix (_crID cr) . crDir +~ rot
BounceBullet bt | crIsArmouredFrom p cr -> w & instantBullets .:~ bouncer
where
bouncer = (aBulAt Nothing id pOut reflectVel (_buDrag bt)
(_buHitEff bt) (_buWidth bt)
bouncer = (aBulAt Nothing pOut reflectVel (_buDrag bt) (_buHitEff bt) (_buWidth bt)
BasicBulletTrajectory
) {_buTimer = _buTimer bt - 1}
pOut = p +.+ 2 *.* newDir
reflectVel = magV bulVel *.* newDir