Move bullets into own data type

This commit is contained in:
2022-07-16 21:15:25 +01:00
parent 22adcb89e0
commit 301946ff8f
21 changed files with 216 additions and 108 deletions
+4 -4
View File
@@ -133,11 +133,11 @@ dirtWallDamage dm wl = case _dmType dm of
wallDamageEffect :: Damage -> Wall -> World -> World
wallDamageEffect dm wl w = case _dmEffect dm of
BounceBullet bt -> w & instantParticles .:~ thebouncer
BounceBullet bt -> w & instantBullets .:~ thebouncer
where
reflectVel = reflVelWall wl (_ptVel bt)
thebouncer = aBulAt Nothing id (Just (_ptColor bt)) pOut reflectVel (_btDrag bt) (_ptHitEff bt) (_ptWidth bt)
& ptTimer .~ _ptTimer bt - 1
reflectVel = reflVelWall wl (_buVel bt)
thebouncer = aBulAt Nothing id (Just (_buColor bt)) pOut reflectVel (_buDrag bt) (_buHitEff bt) (_buWidth bt)
& buTimer .~ _buTimer bt - 1
pOut = p +.+ squashNormalizeV (sp -.- p)
p = _dmAt dm
sp = _dmFrom dm