Final project

This commit is contained in:
Gnarly Narwhal 2019-08-25 17:25:46 -07:00 committed by Gnarwhal
parent e06edeefb8
commit 3ea001fb96
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174
14 changed files with 463 additions and 143 deletions

View file

@ -100,6 +100,8 @@ public class BulletList {
enemies.remove(j);
--j;
}
bullets.remove(i);
--i;
}
}
bullet.position.add(deltaV);
@ -120,8 +122,11 @@ public class BulletList {
Vector2f deltaV = bullet.velocity.mul((float) Main.dtime, new Vector2f());
Collision.Bounds bounds = player.getBounds();
Vector2f[] segments = player.getSegments();
if (Collision.collide(bounds, segments, player.getVelocity(), bullet))
if (Collision.collide(bounds, segments, player.getVelocity(), bullet)) {
player.damage(bullet.damage);
bullets.remove(i);
--i;
}
bullet.position.add(deltaV);
bullet.boundingPosition.add(deltaV);