示例#1
0
        protected override eStateTrans UpdateAction(Entity entity, ref IState <Entity> nextState)
        {
            timer.Update();

            //entity.GetDrawComponent().alpha = 1 - timer.Rate();

            if (timer.IsTime)
            {
                nextState = new MoveState_Com_Player(gameDevice, 0);
                return(eStateTrans.ToNext);
            }

            nextState = this;
            return(eStateTrans.ToThis);
        }
示例#2
0
        protected override eStateTrans UpdateAction(Entity entity, ref IState <Entity> nextState)
        {
            if (state.IsLand)
            {
                float nowSpeed = jumpComp.speed;
                entity.RemoveComponent(jumpComp);
                nextState = new MoveState_Com_Player(gameDevice, nowSpeed);
                return(eStateTrans.ToNext);
            }

            //Damage判定
            if (CollitionCheck(entity))
            {
                entity.RemoveComponent(jumpComp);
                collider.DeActive();
                nextState = new DeathState_Com("Bom", gameDevice);
                return(eStateTrans.ToNext);
            }

            nextState = this;
            return(eStateTrans.ToThis);
        }
示例#3
0
        protected override eStateTrans UpdateAction(Entity entity, ref IState <Entity> nextState)
        {
            if (inputState.WasDown(Keys.Z, Buttons.LeftShoulder))
            {
                Console.WriteLine("Do Move");
                SetEffect();
                nextState = new MoveState_Com_Player(gameDevice, 0);
                return(eStateTrans.ToNext);
            }

            if (inputState.WasDown(InputParameter.LeftKey, InputParameter.LeftButton))
            {
                seasonState.ToBeforeSeason();
            }

            if (inputState.WasDown(InputParameter.RightKey, InputParameter.RightButton))
            {
                seasonState.ToNextSeason();
            }

            nextState = this;
            return(eStateTrans.ToThis);
        }
示例#4
0
        protected override eStateTrans UpdateAction(Entity entity, ref IState <Entity> nextState)
        {
            if (inputState.IsDown(Keys.F))
            {
                attackTimer.Update();
                playerAnim.SetNowAnim("Attack");

                if (attackTimer.IsTime)
                {
                    attackCollider.Destroy(0);
                    playerAnim.SetNowAnim("Idle");
                    nextState = new MoveState_Com_Player(gameDevice, 0);
                    return(eStateTrans.ToNext);
                }
                nextState = this;
                return(eStateTrans.ToThis);
            }
            else
            {
                attackCollider.Destroy(0);
                nextState = new MoveState_Com_Player(gameDevice, 0);
                return(eStateTrans.ToNext);
            }
        }