Skip to main content

Move2DConfig Class

Fluent configuration for 2D movement behavior. More...

Declaration

class helios::engine::builder::gameObject::builders::configs::Move2DConfig { ... }

Public Constructors Index

Move2DConfig (helios::engine::ecs::GameObject gameObject)

Constructs a Move2DConfig and adds required components. More...

Public Member Functions Index

Move2DConfig &speed (const float movementSpeed)

Sets the maximum movement speed. More...

Move2DConfig &acceleration (const float movementAcceleration)

Sets the movement acceleration rate. More...

Move2DConfig &instantAcceleration (const bool useInstantAcceleration)

Enables or disables instant acceleration. More...

Private Member Attributes Index

helios::engine::ecs::GameObjectgameObject_

Non-owning pointer to the target GameObject. More...

Description

Fluent configuration for 2D movement behavior.

Automatically adds required components:

  • Move2DComponent
  • ComposeTransformComponent
  • DirectionComponent
  • TranslationStateComponent

Definition at line 24 of file Move2DConfig.ixx.

Public Constructors

Move2DConfig()

helios::engine::builder::gameObject::builders::configs::Move2DConfig::Move2DConfig (helios::engine::ecs::GameObject gameObject)
inline explicit

Constructs a Move2DConfig and adds required components.

Parameters
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a>

Target GameObject to configure.

Definition at line 38 of file Move2DConfig.ixx.

Referenced by acceleration, instantAcceleration and speed.

Public Member Functions

acceleration()

Move2DConfig & helios::engine::builder::gameObject::builders::configs::Move2DConfig::acceleration (const float movementAcceleration)
inline

Sets the movement acceleration rate.

Parameters
movementAcceleration

Acceleration in units per second squared.

Returns

Reference to this config for chaining.

Definition at line 69 of file Move2DConfig.ixx.

69 Move2DConfig& acceleration(const float movementAcceleration) {
71 ->setMovementAcceleration(movementAcceleration);
72
73 return *this;
74 }

Reference Move2DConfig.

instantAcceleration()

Move2DConfig & helios::engine::builder::gameObject::builders::configs::Move2DConfig::instantAcceleration (const bool useInstantAcceleration)
inline

Enables or disables instant acceleration.

When enabled, the entity reaches max speed immediately.

Parameters
useInstantAcceleration

True for instant acceleration.

Returns

Reference to this config for chaining.

Definition at line 85 of file Move2DConfig.ixx.

85 Move2DConfig& instantAcceleration(const bool useInstantAcceleration) {
87 ->setUseInstantAcceleration(useInstantAcceleration);
88
89 return *this;
90 }

Reference Move2DConfig.

speed()

Move2DConfig & helios::engine::builder::gameObject::builders::configs::Move2DConfig::speed (const float movementSpeed)
inline

Sets the maximum movement speed.

Parameters
movementSpeed

Speed in units per second.

Returns

Reference to this config for chaining.

Definition at line 55 of file Move2DConfig.ixx.

55 Move2DConfig& speed(const float movementSpeed) {
57 ->setMovementSpeed(movementSpeed);
58
59 return *this;
60 }

Reference Move2DConfig.

Private Member Attributes

gameObject_

helios::engine::ecs::GameObject helios::engine::builder::gameObject::builders::configs::Move2DConfig::gameObject_

Non-owning pointer to the target GameObject.

Definition at line 29 of file Move2DConfig.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.