Skip to content

Commit

Permalink
Fix static bumpers being in the wrong position for the first frame
Browse files Browse the repository at this point in the history
  • Loading branch information
swoolcock committed Aug 24, 2024
1 parent db6af62 commit 34e05c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Components/GravityComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public override void Update()
var isInverted = CurrentGravity == GravityType.Inverted;
if (flagValue != isInverted)
{
// TODO: might want to prevent flips if in an opposing gravity field, similar to dash-to-toggle
SetGravity(flagValue ? GravityType.Inverted : GravityType.Normal);
}
}
Expand Down
3 changes: 3 additions & 0 deletions Source/Entities/GravityBumper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public GravityBumper(EntityData data, Vector2 offset)
sine.Active = false;
}

// update the position manually since the sine may have changed since base()
UpdatePosition();

var spriteName = _spriteName;
if (string.IsNullOrWhiteSpace(spriteName))
{
Expand Down

0 comments on commit 34e05c9

Please sign in to comment.