Beispiel #1
0
        public void SelectingState()
        {
            switch (player.State)
            {
            case PlayerState.NORMAL:
                if (rect.Intersects(player.Rect))
                {
                    state = EnemyState.ATTACKING;
                    sword.Reset();
                }
                else if (state == EnemyState.ATTACKING && !rect.Intersects(player.Rect) && sword.IsReady)
                {
                    state = (EnemyState)stateSelector.Next(2);
                    changeState.Reset();
                }
                else if (changeState.IsReady)
                {
                    state = (EnemyState)stateSelector.Next(2);
                    changeState.Reset();
                }
                return;

            case PlayerState.LEVITATING:

                return;

            case PlayerState.FALLING:
                state = EnemyState.RUNNING;
                return;
            }
        }
Beispiel #2
0
        private void Levitating(GameTime gameTime)
        {
            player.Y       = 130;
            player.Gravity = false;

            if (levitating.IsReady)
            {
                qIsOn = false;
                player.movementController.CanJump = true;
                player.Gravity = true;
                firstAbility.Reset();
                player.State = PlayerState.NORMAL;
            }
        }
Beispiel #3
0
        private void UpdateStats(GameTime gameTime)
        {
            if (life < 0)
            {
                life = 0;
            }
            if (energy < 0)
            {
                energy = 0;
            }

            if (energy > maxEnergy)
            {
                energy = maxEnergy;
            }

            if (energy != maxEnergy && second.IsReady)
            {
                energy += 1;
                second.Reset();
                forceOrange = false;
            }
        }