using System; using System.Runtime.CompilerServices; using DodgeEm.View.Sprites; namespace DodgeEm.Model { public class Enemy : GameObject { #region Data members private int speedXDirection; private int speedYDirection; private Random random; #endregion #region Constructors public Enemy() { this.Sprite = new BallSprite(); this.random = new Random(); this.RandomizeSpeed(); base.SetSpeed(this.speedXDirection, this.speedYDirection); } #endregion private void RandomizeSpeed() { this.speedXDirection = this.random.Next(30, 50); this.speedYDirection = this.random.Next(30, 50); } } }