private void OnFire() { m_fireLimit = 0.0f; Vector bulletStartPoint = PlayerUnit.Location + PlayerUnit.Direction.ToVector(); var bulletUnit = new BulletUnit(PlayerUnit.World, bulletStartPoint.ToPointF(), PlayerUnit); bulletUnit.Direction = PlayerUnit.Direction; bulletUnit.FixLocation(); bulletUnit.UserData = new VisualBulletUnit(bulletUnit, Gfx.Instance.GetPlayerBulletFlightAnimation()); PlayerUnit.World.Bullets.Add(bulletUnit); }
private void Fire() { var nLocation = Location + Direction.ToVector(); var unit = new BulletUnit(World, nLocation.ToPointF(), this); unit.Direction = Direction; World.Bullets.Add(unit); m_timeStep = 0.0f; }
public VisualBulletUnit(BulletUnit bulletUnit, SpriteAnimation flightAnimation) { BulletUnit = bulletUnit; FlightAnimation = flightAnimation; }