Esempio n. 1
0
    public override HeroState Update_(HeroMover hero, float deltatime)
    {
        hero.HorizontalMoveInAir(hero.Parameters.MoveInAirParams, deltatime);

        var params_ = hero.Parameters.MoveInAirParams;

        hero.ApplyGravity(params_.Gravity, params_.FallSpeedMax, deltatime);

        if (hero.velocity.Y < 0)
        {
            return(new StateFall());
        }

        return(this);
    }
Esempio n. 2
0
    public override HeroState Update_(HeroMover hero, float deltatime)
    {
        hero.HorizontalMoveInAir(hero.Parameters.MoveInAirParams, deltatime);

        var params_ = hero.Parameters.MoveInAirParams;

        hero.ApplyGravity(params_.Gravity, params_.FallSpeedMax, deltatime);

        if (hero.IsOnGround)
        {
            hero.SoundGroup.Play("Land");
            if (hero.KeyDirection == 0)
            {
                return(new StateWait());
            }
            else
            {
                return(new StateRun());
            }
        }

        return(this);
    }
Esempio n. 3
0
    public override HeroState Update_(HeroMover hero, float deltatime)
    {
        if (fromKick < hero.Parameters.KickParams.FromKickToInputEnabled)
        {
            fromKick += deltatime;
            if (fromKick >= hero.Parameters.KickParams.FromKickToInputEnabled)
            {
                hero.CanMove = true;
            }
        }

        hero.HorizontalMoveInAir(hero.Parameters.MoveInAirParamsAfterKick, deltatime);

        var params_ = hero.Parameters.MoveInAirParamsAfterKick;

        hero.ApplyGravity(params_.Gravity, params_.FallSpeedMax, deltatime);

        if (hero.velocity.Y < 0)
        {
            return(new StateFall());
        }

        return(this);
    }