예제 #1
0
        public void battleCommands()
        {
            if (JustPressed(Keys.Space) && custom.custom == custom.customMax)
            {
                custom.Open();
            }

            if (moveKey() != new Vector2(0, 0))
            {
                navi.Move(moveKey());
            }

            if (JustPressed(Keys.Z))
            {
                navi.Buster();
            }
            if (JustPressed(Keys.X) && navi.chips.Count() > 0 && navi.canAttack())
            {
                navi.chips[0].Use(navi);
                navi.chips.RemoveAt(0);
            }

            //Does a charged attack
            if (IsHeld(Keys.Z))
            {
                if (!(navi.charged | navi.isAttacking))
                {
                    navi.isCharging = true;
                    if (!playedCharge)
                    {
                        charge.Play();
                        playedCharge = true;
                    }
                }
                if (!playedChargeComplete && navi.charged)
                {
                    playedChargeComplete = true;
                    chargeComplete.Play();
                }
            }

            if (IsReleased(Keys.Z))
            {
                if (navi.charged)
                {
                    navi.chargedAttack(navi);
                }
                playedCharge         = false;
                playedChargeComplete = false;
                navi.isCharging      = false;
                navi.charged         = false;
            }
        }