First off, I put this in General, because it has to do with both scripting and physics (I think).
Basically I want to know, how 2D games, which feature animated sprites for attacks, handle detecting collisions? For example, how does the game know when you hit the enemy, or the enemy hits you.
If it’s an animated sprite, you can’t do something like parent a weapon, and then check if that weapon collided with an enemy. Because the weapon and the character are one object.
The only game I remember that does this, is Captain Claw. And it also does it very well. But I have no idea how.
I have found 2 similar tutorials on this in the past. One for a “Rouge-like” game, and the other for a 2D platformer.
However one has the player take damage as soon as he collides with the enemy, even if it’s just something like his knife colliding. And the other has the enemy fire missiles at the player, rather than also having to physically collide with the player and then play an attack animation.