public BulletManager(int pool) { bullets = new Weapons.Bullet[pool]; for (int i = 0; i < bullets.Length; i++) { bullets[i] = new Weapons.Bullet(); } }
public Vector2 GetBulletCollisionVelocity(Rectangle otherRectangle) { for (int i = 0; i < mapObjects.Count; i++) { if (mapObjects[i] is Weapons.Bullet) { if (mapObjects[i].CollisionRectangle.Intersects(otherRectangle)) { Weapons.Bullet bullet = (Weapons.Bullet)mapObjects[i]; bullet.Destroy = true; return(bullet.Velocity); } } } return(Vector2.Zero); }