Commit before perhaps rethinking item structure
This commit is contained in:
@@ -94,8 +94,11 @@ shellCollisionCheck pj w
|
||||
time = _pjTimer pj
|
||||
oldPos = _pjPos pj
|
||||
|
||||
-- note this doesn't take into account moving walls, which may break the
|
||||
-- bouncing in some way
|
||||
tryShellBounce :: (Point2, Either Creature Wall) -> Projectile -> World -> World
|
||||
tryShellBounce (p, Right wl) pj w
|
||||
| Just GStick <- pj ^? pjType . gnHitEffect = w
|
||||
| Just x <- pj ^? pjType . gnHitEffect . bounceTolerance =
|
||||
if abs (dotV (pj ^. pjVel) (vNormal hitline)) < x
|
||||
then w & cWorld . lWorld . projectiles . ix (_pjID pj) . pjVel %~ reflectIn
|
||||
|
||||
Reference in New Issue
Block a user