Beispiel #1
0
        /// <summary>
        /// Creates an instance of a new vase.
        /// </summary>
        /// <param name="position">Middle position of the new vase.</param>
        public static void NewVase(Vector2 position)
        {
            Moveable_Object vase = new Moveable_Object(SpriteSheetManager.vase, 1, 1, 1, position, new Point(32, 32));

            vase.currentFrame.X = rnd.Next(vase.spriteSheet.sheetSize.X + 1);
            vaseList.Add(vase);
        }
 /// <summary>
 /// Checks if the Projectile can inflict damage to the assigned target.
 /// </summary>
 /// <param name="target">Specific target to damage check.</param>
 public void CheckTargetCollision(Moveable_Object target)
 {
     if (target.hitbox.Intersects(hitbox))
     {
         isColliding    = true;
         target.health -= (damage * damageMultiplyier);
         target.damaged = true;
     }
 }
 /// <summary>
 /// Checks if the player can inflict melee damage on a target
 /// </summary>
 /// <param name="target">Specific target to damage check</param>
 public void InflictMeleeDamage(Moveable_Object target)
 {
     if (equippedMelee != null && !target.beenHit)
     {
         if (target.hitbox.Intersects(equippedMelee.damageHitbox))
         {
             target.damaged = true;
             target.health -= (equippedMelee.baseDamage * equippedMelee.damageMultiplyier * damageMultiplier);
             target.beenHit = true;
         }
     }
 }
        public Enemy(SpriteSheet spriteSheet, double timeBetweenFrames, int speed, int spottingRange, int attackRange, int attackRangeOverlap, double attackSpeed, float health, float maxHealth, int spawnWeight, int damage, Moveable_Object projectile, int projectileSpeed) : base(spriteSheet, timeBetweenFrames, health, maxHealth)
        {
            hitbox.Size = spriteSheet.frameSize;

            base.speed              = speed;
            this.spottingRange      = spottingRange;
            this.attackRange        = attackRange;
            this.attackRangeOverlap = attackRangeOverlap;
            this.attackSpeed        = attackSpeed;
            this.spawnWeight        = spawnWeight;
            this.damage             = damage;
            this.projectile         = projectile;
            this.projectileSpeed    = projectileSpeed;

            isRanged = true;
        }