Move bullets into own data type
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user