Module drag

[hook-sys] Slows down specified entities over time, eventually stopping them.

Required hooks: update.

When an entity's speed drops below 1 game unit per update (~0.06U/s), its speed is set to zero and its drag comp is removed. On non-ECS builds, its velocity comp is also removed.

Comps

velocity [non-ECS] Move an entity at a specified velocity.
drag Apply drag to an entity.


Comps

See ecs for details of how to apply comps to an entity.
velocity
[non-ECS] Move an entity at a specified velocity.
  • x number The x component of the velocity.
  • y number The y component of the velocity.
drag
Apply drag to an entity.
  • lambda number What proportion of its speed the entity should retain after one second; default 0.5. (optional)
generated by LDoc 1.5.0