You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insight: On every frame, we loop through dynamic actors (characters, traps, teleport door, etc) and detect for collision.
Here's my quick thought on the structure: Each actor has a onCollide(&Actor otherActor) method that runs conditional code based on what the type of the other actor is. There is a contact listener that calls the onCollide method for the actors.
Here's a very relevant file from the homegrown physics branch of Parryt. For whoever completes this issue, please refer to this for how to implement the actual math of the collisions.
pros and cons of using circles, and of using rectangles
There's no real pros or cons. Both systems are very simple to implement and we will likely have to use both. For each entity, just use the shape that most closely approximates the shape of that entity. Walls will be rectangles, characters will likely be circles (for a top-down view game), etc.
Likely most will be circle collisions
The text was updated successfully, but these errors were encountered: