Game-Design / Sprint2 / Sprint2_actual / Link State Files / LinkStateUpAttack.cs
LinkStateUpAttack.cs
Raw
namespace Sprint2_actual.StateFiles
{
    public class LinkStateUpAttack : ILinkState
    {
        private Link link;
        private int counter = 40;

        public LinkStateUpAttack(Link link)
        {
            this.link = link;
            link.linkSprite = new LinkSpriteUpAttack(link);
        }
        public void Update()
        {
            counter--;
            if(counter == 0)
            {
                link.state = new LinkStateUpIdle(link);
            }
        }

        public void MoveLeft()
        {
            //NO-OP
            //Can't move while attacking
        }

        public void TakeDamage()
        {
            link.game.Player = new DamagedLink(link);
            //TO-DO: How does game get in here? Is there any alternative to passing game?
        }

        public void MoveRight()
        {
            //NO-OP
            //Can't move while attacking
        }

        public void MoveUp()
        {
            //NO-OP
            //Can't move while attacking
        }

        public void MoveDown()
        {
            //NO-OP
            //Can't move while attacking
        }
        public void Idle()
        {
            //NO-OP
            //Can't move while attacking
        }
        public void Attack()
        {
            //NO-OP
            //Already attacking
        }
        public void UseItem()
        {
            //NO-OP
            //Can't use item while moving
        }
    }
}