public override void Fire() { if (refireCount == refireTime && clipAmmo > 0 && !reloading) { Vector2 velocity = new Vector2((float)Math.Sin(gun.Rotation), -(float)Math.Cos(gun.Rotation)) * 75f; Bullet b = new TestBullet(world, this.collisionCat, gun.Position, velocity); gun.ApplyForce(velocity * b.Mass * -1); bullets.Add(b); if (bullets.Count > 50) bullets.RemoveAt(0); } base.Fire(); }
public override void Fire() { if (refireCount == refireTime && clipAmmo > 0 && !reloading) { Vector2 velocity = new Vector2((float)Math.Sin(gun.Rotation), -(float)Math.Cos(gun.Rotation)) * 75f; Bullet b = new TestBullet(world, this.collisionCat, gun.Position, velocity); gun.ApplyForce(velocity * b.Mass * -1); bullets.Add(b); if (bullets.Count > 50) { bullets.RemoveAt(0); } } base.Fire(); }