Skip to content

Commit

Permalink
Display platform velocity in InfoHUD
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Mar 2, 2024
1 parent bde34bf commit 27220dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Actors/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public enum Events { Land }; // TAS: publicized
private Vec3 velocity;
private Vec3 previousVelocity;
private Vec3 groundNormal;
private Vec3 platformVelocity;
private float tPlatformVelocityStorage;
public Vec3 platformVelocity; // TAS: publicized
public float tPlatformVelocityStorage; // TAS: publicized
private float tGroundSnapCooldown;
private Actor? climbingWallActor;
private Vec3 climbingWallNormal;
Expand Down
11 changes: 11 additions & 0 deletions Source/TAS/InfoHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ public static void RenderGUI()
ImGui.Text(string.Empty);

List<string> statues = new();
if (player.tPlatformVelocityStorage > 0)
{
Vec3 add = player.platformVelocity;

add.Z = Calc.Clamp(add.Z, 0, 180);
if (add.XY().LengthSquared() > 300 * 300)
add = add.WithXY(add.XY().Normalized() * 300);

statues.Add($"PlatformSpeed({add})");
}

if (player.tCoyote > 0)
statues.Add($"Coyote({player.tCoyote.ToFrames()})@{player.coyoteZ.ToFormattedString(Save.Instance.InfoHudDecimals)}");
if (player.tClimbCooldown > 0)
Expand Down

0 comments on commit 27220dd

Please sign in to comment.