CheckpointComponent class

Marks an entity as a checkpoint / respawn point.

Attach this to a trigger-zone entity. The CheckpointSystem scans all player entities (tagged with the playerTag) and activates the nearest checkpoint the player overlaps.

Usage:

world.createEntity([
  TransformComponent(position: Vector3.fromXY(400, 300)),
  CheckpointComponent(respawnPosition: Vector3.fromXY(400, 260)),
]);
Inheritance

Constructors

CheckpointComponent({required Vector3 respawnPosition, double radius = 48.0, bool isActivated = false})
Create a checkpoint component.

Properties

componentType → Type
Type identifier for this component
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isActivated ↔ bool
Whether this checkpoint has already been activated.
getter/setter pair
radius ↔ double
Activation radius in world units.
getter/setter pair
respawnPosition ↔ Vector3
World-space position the player is moved to on respawn.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttach(EntityId entityId) → void
Called when this component is added to an entity.
inherited
onDetach(EntityId entityId) → void
Called when this component is removed from an entity.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited