Exemplo n.º 1
0
 public EnemyCharacter(EnemyCharacter enemy)
 {
     this.Name           = enemy.Name;
     this.CharacterID    = enemy.CharacterID;
     this.CharacterStats = enemy.CharacterStats;
     this.BehaviorList   = enemy.BehaviorList;
     foreach (CharacterAnimation anim in enemy.CharacterAnimationList)
     {
         var copy = new CharacterAnimation()
         {
             SpriteFileName = anim.SpriteFileName, SpriteRowCol = anim.SpriteRowCol, SpriteFramesCount = anim.SpriteFramesCount
         };
         this.CharacterAnimationList.Add(copy);
     }
 }
Exemplo n.º 2
0
        public int GetEnemyRow(EnemyCharacter enemy)
        {
            var row = 0;

            foreach (EnemyCharacter e in EnemyList)
            {
                if (enemy == e)
                {
                    return(row);
                }
                row++;
            }

            return(-1);
        }
Exemplo n.º 3
0
        public void DeleteEnemyElement(EnemyCharacter enemy, List <EnemyCharacter> EnemyList, Grid enemyField, Grid enemyMenu)
        {
            for (int i = 0; i < EnemyList.Count; i++)
            {
                if (EnemyList[i] == enemy)
                {
                    var             grid    = (Canvas)enemyField.Children[i];
                    DoubleAnimation fadeOut = new DoubleAnimation();
                    fadeOut.From     = 1;
                    fadeOut.To       = 0;
                    fadeOut.Duration = new Duration(TimeSpan.FromMilliseconds(200));
                    grid.BeginAnimation(UIElement.OpacityProperty, fadeOut);

                    DeleteEnemyStatus(i, enemyMenu);
                }
            }
        }