Skip to content

Commit

Permalink
Merge pull request #46 from selimnahimi/movement-update
Browse files Browse the repository at this point in the history
Updated movement logic
  • Loading branch information
selimnahimi authored Sep 1, 2023
2 parents c4ef98f + 00cee01 commit 8a5c2db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions code/pawn/PawnController.Wallrunning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ bool CanWallrun( WallRunTrace traceWall )
if ( Wallrunning == WallRunSide.Right && traceWall.side != WallRunSide.Right )
return false;

if ( !IsWallRunning() && (Entity.Velocity * 0.5f).WithZ( 0 ).Length < 100f )
return false;

if ( IsWallRunning() && Entity.Velocity.WithZ( 0 ).Length < 100f )
return false;

Expand Down
9 changes: 7 additions & 2 deletions code/pawn/PawnController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace RunnerVision;
public partial class PawnController : EntityComponent<Pawn>
{
public int StepSize => 26;
public int GroundAngle => 100;
public int GroundAngle => 200;
public int JumpSpeed => 300;
public float Gravity => 800f;
public float StartingSpeed => 1000f;
Expand Down Expand Up @@ -87,7 +87,6 @@ public void Simulate( IClient cl )

UpdateMaxSpeed( moveVector );
AdjustSharpTurn( moveVector );
UpdateMoveHelper( groundEntity );

if ( groundEntity.IsValid() )
{
Expand All @@ -96,6 +95,12 @@ public void Simulate( IClient cl )
InitiateLandingOnFloor();
}

}

UpdateMoveHelper( groundEntity );

if (Grounded)
{
DoMovement( moveVector );
}
else
Expand Down

0 comments on commit 8a5c2db

Please sign in to comment.