Exide / top-down-arena-shooter

MIT License
0 stars 0 forks source link

Basic collision detection #4

Closed Exide closed 6 years ago

Exide commented 6 years ago

We need a way to detect when a player runs into the wall of the arena or another player. Both cases should cause damage to each player involved and remove velocity in the direction of the impact.

Exide commented 6 years ago

I found an open-source (MIT license) implementation of the Separating Axis Theorem in JS: https://github.com/jriecken/sat-js

Exide commented 6 years ago

This is what I found when researching quad trees, spatial hashing, etc.

Exide commented 6 years ago

Collisions are being detected but no action is taken.

Exide commented 6 years ago

I'm replacing jriecken/sat-js with my own implementation. It would provide me with more optimization potential but also I've done this a few times and I would like to see what I can remember :p

Some useful links regarding the Separating Axis Theorem: