/// <summary>
 /// Initializes a new instance of the <see cref="SniperProjectile"/> class.
 /// </summary>
 /// <param name="enemy"> The enemy to follow. </param>
 /// <param name="spawnPosition"> The spawn position. </param>
 /// <param name="attackDamage"> The attack damage. </param>
 /// <param name="towerSource"> The tower that spawned this projectile. </param>
 public SniperProjectile(Enemy enemy, PointF spawnPosition, float attackDamage, Tower towerSource)
     : base(enemy, attackDamage, towerSource, spawnPosition)
 {
     // Set tower properties
     this.SpriteSheetSource = new Rectangle(102, 200, 9, 5);
     this.MoveSpeed = 100;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FrostProjectile"/> class.
 /// </summary>
 /// <param name="enemy"> The enemy to follow. </param>
 /// <param name="spawnPosition"> The spawn position. </param>
 /// <param name="attackDamage"> The attack damage. </param>
 /// <param name="slowDuration"> The time in seconds to slow the enemy. </param>
 /// <param name="slowAmount"> The effect of the slow, the enemies speed is multiplied by this value. </param>
 /// <param name="towerSource"> The tower that spawned this projectile. </param>
 public FrostProjectile(Enemy enemy, PointF spawnPosition, float attackDamage, float slowDuration, float slowAmount, Tower towerSource)
     : base(enemy, attackDamage, towerSource, spawnPosition)
 {
     // Set tower properties
     this.slowDuration = slowDuration;
     this.slowAmount = slowAmount;
     this.SpriteSheetSource = new Rectangle(100, 187, 13, 6);
     this.MoveSpeed = 200;
 }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Projectile"/> class.
        /// </summary>
        /// <param name="enemy"> The enemy to follow. </param>
        /// <param name="attackDamage"> The attack damage. </param>
        /// <param name="towerSource"> The tower that spawned this projectile. </param>
        /// /// <param name="spawnPosition"> The spawn position. </param>
        public Projectile(Enemy enemy, float attackDamage, Tower towerSource, PointF spawnPosition)
        {
            // Assign members
            this.Position = spawnPosition;
            this.EnemyTarget = enemy;
            this.CurrentTarget = this.EnemyTarget.Position;
            this.attackDamage = attackDamage;
            this.towerSource = towerSource;

            // Set the depth level of projectiles
            this.DepthLevel = GameSettings.ProjectileDepthLevel;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="StandardProjectile"/> class.
 /// </summary>
 /// <param name="enemy"> The enemy to follow. </param>
 /// <param name="spawnPosition"> The spawn position. </param>
 /// <param name="attackDamage"> The attack damage. </param>
 /// <param name="towerSource"> The tower that spawned this projectile. </param>
 public StandardProjectile(Enemy enemy, PointF spawnPosition, float attackDamage, Tower towerSource)
     : base(enemy, attackDamage, towerSource, spawnPosition)
 {
     this.SpriteSheetSource = new Rectangle(100, 179, 14, 7);
     this.MoveSpeed = 200;
 }