-
Notifications
You must be signed in to change notification settings - Fork 8
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
Handling collision with robot-wall #10
Comments
There are two different approaches we can do right now: First is to modify the collidable component to accept a callback function. This function will take 2 args: the ID of the entity (self) and the ID of the entity I'm colliding to. A different option would be to have the Collidable component accept a string, which would be the event tag for a reactive system. Upon colliding, the entity would fire up that event (e.g. add the event to the EventStore) to be picked up by the matching system. Of course, in the future we might have both, but to begin with something, what do you guys think? |
I preferer events =) |
If we add custom event tags then we can have custom collision handling systems. Adding the tags would allow for each system to retrieve from the EventStore only the events directed at them. It would have the form (tag, entity A, entity B). Not every object reacts the same way when colliding, so I think it makes sense to have different systems for that. |
Robots now stop when they collide to a Wall (changes). I will NOT be closing this issue though, because that is a very crude implementation. |
It looks like a collision handling logic for me, not collision detection logic. In that case I would make a single system handling collisions calling different sub-behaviors. |
It is already implemented a detection collision system but the collision is not handled. This means that as is a robot can pass through a wall or another robot.
We should implement a system that makes the robot bounce back when it collides with a wall.
The text was updated successfully, but these errors were encountered: