Fighting Game Hitbox Detection
Posted: Sun Mar 05, 2017 4:54 pm
So, I'm in the starting stages of creating a simple 2D fighter in Löve, not unlike Street Fighter. My question is how would I go about implementing hitboxes for such a game - I've implemented my own collision detection system with axis-aligned hitboxes in the past, but seeing as this is a fighter, I will most likely need to work with diagonal rectangles for the hitboxes. My first notion was to go with a library like HardonCollider, but I feel like it may be a bit overkill. This is because, at any given point in my game, there are, at most, only 3 collisions that need to be checked:
If player one's hitbox is colliding with player two's hurtbox (only if player one is attacking)
If player two's hitbox is colliding with player one's hurtbox (only is player two is attacking)
If player one's hurtbox is colliding with player two's hurtbox (i.e. the players are touching each other)
Thus, I'm at a crossroads. On one hand, using a library such as HardonCollider seems like overkill for my purposes, but on the other hand, I would have no idea where to start in terms of dealing with diagonal hitboxes. What do you all suggest? Is HardonCollider still the best option in this scenario, or is there some simple method for dealing with these hitboxes that I'm just not aware of?
If player one's hitbox is colliding with player two's hurtbox (only if player one is attacking)
If player two's hitbox is colliding with player one's hurtbox (only is player two is attacking)
If player one's hurtbox is colliding with player two's hurtbox (i.e. the players are touching each other)
Thus, I'm at a crossroads. On one hand, using a library such as HardonCollider seems like overkill for my purposes, but on the other hand, I would have no idea where to start in terms of dealing with diagonal hitboxes. What do you all suggest? Is HardonCollider still the best option in this scenario, or is there some simple method for dealing with these hitboxes that I'm just not aware of?