/// <summary> /// Initializes a new instance of the <see cref="PlayerCar"/> class. /// </summary> /// <param name="pos">Post as ActiveLane enum.</param> /// <param name="width">Width as int.</param> /// <param name="height">Height as int.</param> public PlayerCar(ActiveLane pos, int width, int height) : base(pos, width, height) { this.Health = GameObjectConfig.BaseCarHealth; this.Speed = GameObjectConfig.BaseCarSpeed; this.SetY(GameObjectConfig.PlayerCarStartY); }
/// <summary> /// Initializes a new instance of the <see cref="Car"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public Car(ActiveLane pos, int width, int height) : base(pos, width, height) { int x = 0; int y = -160; if (pos == ActiveLane.LEFT) { x = 103; } if (pos == ActiveLane.MIDDLE) { x = 254; } if (pos == ActiveLane.RIGHT) { x = 405; } this.Area = new Rect(x, y, width, height); }
/// <summary> /// Initializes a new instance of the <see cref="PoliceCar"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> /// <param name="y">Y coordinate.</param> public PoliceCar(ActiveLane pos, int width, int height, double y) : base(pos, width, height, y) { }
/// <summary> /// Initializes a new instance of the <see cref="PoliceCar"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public PoliceCar(ActiveLane pos, int width, int height) : base(pos, width, height) { }
/// <summary> /// Initializes a new instance of the <see cref="Explosion"/> class. /// </summary> /// <param name="pos">Position as ActiveLane enum.</param> /// <param name="width">Width as int.</param> /// <param name="height">Height as int.</param> public Explosion(ActiveLane pos, int width, int height) : base(pos, width, height) { this.State = 1; }
/// <summary> /// Initializes a new instance of the <see cref="TrafficCar"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> /// <param name="y">Y coordinate as double.</param> public TrafficCar(ActiveLane pos, int width, int height, double y) : this(pos, width, height) { SetY(y); }
/// <summary> /// Initializes a new instance of the <see cref="TrafficCar"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public TrafficCar(ActiveLane pos, int width, int height) : base(pos, width, height) { }
/// <summary> /// Initializes a new instance of the <see cref="GameObject"/> class. /// </summary> /// <param name="pos">Position as ActiveLane enum.</param> /// <param name="width">Width as int.</param> /// <param name="height">Height as int.</param> public GameObject(ActiveLane pos, int width, int height) { this.position = pos; this.area.Width = width; this.area.Height = height; }
/// <summary> /// Initializes a new instance of the <see cref="EnemyCar"/> class. /// </summary> /// <param name="pos">Lane position as ActiveLane enum.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> /// <param name="y">Y coordinate as int.</param> public EnemyCar(ActiveLane pos, int width, int height, int y) : base(pos, width, height) { this.SetY(y); }
/// <summary> /// Initializes a new instance of the <see cref="Bullet"/> class. /// </summary> /// <param name="pos">Position.</param> /// <param name="width">Width.</param> /// <param name="height">Height.</param> /// <param name="x">X coordinate.</param> /// <param name="y">Y coordinate.</param> public Bullet(ActiveLane pos, int width, int height, int x, int y) : base(pos, width, height) { this.Area = new Rect(x, y, width, height); }