Ejemplo n.º 1
0
    private void Attack(string direction)
    {
        Enemy enemy = null;

        if (direction.Contains("Horizontal"))
        {
            AudioManager.Instance.PlaySound("Slash");
            playerAnimations.AttackHorizontal();
            hasMoved = true;

            if (IsEnemyInRange(ref enemy))
            {
                playerActions.AttackHorizontal(enemy);
            }
        }
        else if (direction.Contains("Vertical"))
        {
            AudioManager.Instance.PlaySound("Slash");
            playerAnimations.AttackVertical();
            hasMoved = true;

            if (IsEnemyInRange(ref enemy))
            {
                playerActions.AttackVertical(enemy);
            }
        }
    }
Ejemplo n.º 2
0
 public void AttackVertical(Enemy enemy)
 {
     enemy.Hit("Vertical");
     playerAnimations.AttackVertical();
 }