Skip to content

Iterating two lists from a system #55

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

Open
Freaksed opened this issue Mar 10, 2023 · 1 comment
Open

Iterating two lists from a system #55

Freaksed opened this issue Mar 10, 2023 · 1 comment

Comments

@Freaksed
Copy link

How would I check two entity sets against each other? As a specific example having items that can be picked up by a player. So I have a system that iterates all the pickable items and checks their distance against the players, if the player is in range the item gets picked up and added to their inventory.

@clinuxrulz
Copy link

I believe you can execute query for your second list from inside your system:

protected query(componentTypes: number[]): Iterator<Entity> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants