Skip to content

Commit

Permalink
/vg/ Tile Movement v1.0 (#30)
Browse files Browse the repository at this point in the history
* First iteration on tile movement.

* Why's there an extra tab everywhere, huh?

* Some work and cleanup on tile movement.

* Some work on tile movement smoothness (wow it's... just like pixel movement right now!)

* Some more work on tile movement and improvements.

* Most everything done needed for the first "good" release of tile movement.

* Docs cleanup for tile movement

---------

Co-authored-by: spess-empyrean <[email protected]>
  • Loading branch information
spess-empyrean and spess-empyrean authored Jan 1, 2025
1 parent 7b5619b commit 2796b03
Show file tree
Hide file tree
Showing 2 changed files with 253 additions and 74 deletions.
27 changes: 23 additions & 4 deletions Content.Shared/Movement/Components/TileMovementComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Numerics;
using Content.Shared.Movement.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Map;

Expand All @@ -17,6 +18,18 @@ public sealed partial class TileMovementComponent : Component
[AutoNetworkedField]
public bool SlideActive;

/// <summary>
/// Local coordinates from which the current slide first began.
/// </summary>
[AutoNetworkedField]
public EntityCoordinates Origin;

/// <summary>
/// Local coordinates of the target of the current slide.
/// </summary>
[AutoNetworkedField]
public Vector2 Destination;

/// <summary>
/// This helps determine how long a slide should last. A slide will continue so long
/// as a movement key (WASD) is being held down, but if it was held down for less than
Expand All @@ -26,14 +39,20 @@ public sealed partial class TileMovementComponent : Component
public TimeSpan? MovementKeyInitialDownTime;

/// <summary>
/// Coordinates from which the current slide first began.
/// Move buttons used to initiate the current slide.
/// </summary>
[AutoNetworkedField]
public EntityCoordinates Origin;
public MoveButtons CurrentSlideMoveButtons;

/// <summary>
/// Coordinates of the target of the current slide local to the parent grid.
/// Local coordinates of the entity on the last physics tick.
/// </summary>
[AutoNetworkedField]
public Vector2 Destination;
public Vector2 LastTickPosition;

/// <summary>
/// Whether this entity was weightless last physics tick.
/// </summary>
[AutoNetworkedField]
public bool WasWeightlessLastTick;
}
Loading

0 comments on commit 2796b03

Please sign in to comment.