예제 #1
0
    private bool isInAttackFrame(BaseWalkingAnimSprite.Direction dir)
    {
        switch (dir)
        {
        case BaseWalkingAnimSprite.Direction.UP:
            if (attackOne)
            {
                return(currentFrame >= 42 && lastFrame <= 41);
            }
            else
            {
                return(currentFrame >= 52 && lastFrame <= 51);
            }

        case BaseWalkingAnimSprite.Direction.DOWN:
            if (attackOne)
            {
                return(currentFrame >= 4 && lastFrame <= 5);
            }
            else
            {
                return(currentFrame >= 15 && lastFrame <= 14);
            }

        case BaseWalkingAnimSprite.Direction.LEFT:
            if (attackOne)
            {
                return(currentFrame >= 23 && lastFrame <= 24);
            }
            else
            {
                return(currentFrame >= 34 && lastFrame <= 33);
            }

        case BaseWalkingAnimSprite.Direction.RIGHT:
            if (attackOne)
            {
                return(currentFrame >= 62 && lastFrame <= 63);
            }
            else
            {
                return(currentFrame >= 72 && lastFrame <= 71);
            }
        }
        return(false);
    }
예제 #2
0
 public override void Attack(BaseWalkingAnimSprite.Direction direction)
 {
     if (!attackOne && !attackTwo)
     {
         hasCheckedHitBox      = false;
         this.currentDirection = direction;
         attackOne             = true;
         this.play("attack_" + direction.ToString().ToLower(), true);
         player.CurrentState = BaseWalkingAnimSprite.State.ATTACKING;
         this.alpha          = 1;
         this.count          = 0;
     }
     else if (!attackTwo && attackOne)   //In attack one but not started attack 2 yet
     {
         hasCheckedHitBox      = false;
         this.currentDirection = direction;
         attackOne             = false;
         attackTwo             = true;
         this.play("attackTwo_" + direction.ToString().ToLower(), true);
         player.CurrentState = BaseWalkingAnimSprite.State.ATTACKING;
         this.alpha          = 1;
         this.count          = 0;
     }
 }
예제 #3
0
 public abstract void Attack(BaseWalkingAnimSprite.Direction direction);