Skip to content
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

Initial collision system #14

marot opened this issue Apr 22, 2019 · 1 comment


None yet
2 participants
Copy link

commented Apr 22, 2019

A quick solution should be implemented until a real collision system exists. For now we consider entities to have a circle as their bounds.

The collision system should:

  1. Calculate (based on radius) what entities intersect each other
  2. If entities intersect, a repelling force is applied so that the entities move away from each other. The repelling force is inversely proportional to the distance between the entities.
  3. An entity in conflict can't move so that the distance to any of the conflict partner decreases.
  4. A collision start event will be dispatched when a collision starts
  5. A collision end event will be dispatched when the collision ends
  6. The spawning should be modified so that there are no conflicts at start

The combat system should be aware of the whole duration of the collision, since attacks are performed every second as long as there is a conflict. Because of that the collision events are split into start and stop events.
Another approach would be to send a collision event every iteration.

The point 3. exists in case an entity collides with two other entities at the same time along one vector, to avoid jittering.

@erlend-sh erlend-sh added this to the 0.1 MVP milestone Apr 25, 2019


This comment has been minimized.

Copy link

commented Apr 25, 2019

Completed in #18

@erlend-sh erlend-sh closed this Apr 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.