Skip to content
Discussion options

You must be logged in to vote

You have different options:

  • You can add more data, so you can fine tune each entity.
/// The current acceleration, so the speed can augment progressively
#[derive(Component)]
struct Acceleration {
    current: f32,
}
/// a configuration for each entity, like the acceleration rate.
#[derive(Component)]
struct AccelerationChange {
    change_per_frame: f32,
}
/// Another configuration to know when the acceleration is too much, or not get an unsupported speed.
#[derive(Component)]
struct MaxSpeed(f32);
  • Those additional data could also be stored in a Resource, might be interesting if you have multiple similarly configured entities.
  • If you need more specific logic, it might be practical to …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by H4ppy-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
A-ECS Entities, components, systems, and events
2 participants