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); }
public override HeroState Update_(HeroMover hero, float deltatime) { var params_ = hero.Parameters; hero.ApplyGravity(params_.BendParams.Gravity, params_.MoveInAirParams.FallSpeedMax, deltatime); if (hero.IsOnGround) { hero.ApplyFriction(hero.Parameters.RunParams.Friction, deltatime); } secondsAfterEnter += deltatime; if (secondsAfterEnter >= hero.Parameters.BendParams.BendBackSeconds) { return(new StateFall()); } return(this); }
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); }
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); }