-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I access all entities with a certain component? #740
Comments
Have you read through the SPECS book? |
Yeah I've read through it :( Basically, what I need is a way to just do like "Entities.get_entity_with_tag("paddle")" or something like that. Because, I need to access the Transform component on the paddle Entity from the ball System to check for collisions. |
I figured out a temporary solution. Is this good? impl<'a> System<'a> for BallSystem {
} |
Yes. SPECS does not support querying for specific entities with certain components, only the set of all entities with a particular set of components. If specific entities have a special meaning in your project then I'd advise storing their |
Ok! Thank you for your help! I'm not very experienced with Rust if you couldn't tell XD |
To learn specs, I'm working on making a breakout clone. So, for the Ball component, I need to be able to access the Paddle to get it's position (for collisions). And, I can't figure out how to do it :(
The text was updated successfully, but these errors were encountered: