Checkpoint
namespace Griff.Scenes;
public sealed class Checkpoint : ComponentA place to come back to: when something it accepts (see Layers) touches it, it becomes the active checkpoint, and a Health with Respawn comes back here after dying. Needs a collider, usually a trigger.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”Active
Section titled “Active”public bool Active { get; set; }True for the checkpoint reached last; only one is active at a time. Tick it in the Scene to start playtesting from there.
ActiveTint
Section titled “ActiveTint”public Color ActiveTint { get; set; }The color its sprite turns once reached, so players can see it’s been reached. Transparent leaves it alone.
Layers
Section titled “Layers”public string? Layers { get; set; }The collision layers that reach it, e.g. “Player”. Empty lets anything with a Body reach it.
Message
Section titled “Message”public string? Message { get; set; }A message sent with Game.Send when it’s reached, with this entity as its data.
public string? Sound { get; set; }A sound played when it’s reached, e.g. “Sounds/checkpoint.wav”.
Methods
Section titled “Methods”AcceptsLayer
Section titled “AcceptsLayer”public bool AcceptsLayer(string? layer)True if something on collision layer layer can reach it.
Events
Section titled “Events”Reached
Section titled “Reached”public event Action<Entity>? ReachedRaised when it’s reached (not again while it’s still the active one), with whatever reached it.