public TankShip(Point2D position) { Mover = new MovingBehavior(this); Type = FlyingObjectType.Tank; HorizontalSpeed = -Speed; VerticalSpeed = 0; HealthPoints = mHealthPoints; Brush = mBrush; base.Size = Size; Position = position; }
public Bullet(FlyingObject source) { Mover = new MovingBehavior(this); HorizontalSpeed = source is PlayerShip ? Speed : -Speed; Type = source is PlayerShip ? FlyingObjectType.PlayerBullet : FlyingObjectType.EnemyBullet; HealthPoints = mHealthPoints; base.Size = Size; Brush = source is PlayerShip ? mPlayerBrush : mEnemyBrush; Position = source is PlayerShip ? new Point2D(source.Position.X + source.Size.Width / 2 + Size.Width / 2, source.Position.Y) : new Point2D(source.Position.X - source.Size.Width / 2 - Size.Width / 2, source.Position.Y); }
public Meteorite(Point2D position) { Mover = new MovingBehavior(this); Type = FlyingObjectType.Meteorite; HorizontalSpeed = -Speed; VerticalSpeed = Speed; HealthPoints = mHealthPoints; Brush = mBrush; int diameter = random.Next(70, 111); Size = new Size(diameter, diameter); Position = position; }