Why Hitbox Separate From Player Sprite?

I’ve seen this done in several tutorials and yet I didn’t pick up why this is done. Why not just use the player sprite?

One reason I can think of is if you need a character to be hit in the head because they are wearing armor on the body. Or maybe if someone gets shot in the foot you don’t want that to count the same as a shot to the face.

1 Like

Ah yes, you could make a character customization feature using this, if you wanted to have an equipable helmet you could simply change a helmet sprite and then have it drawn over the hitbox. would come in handy for any game with a lot of graphical variation of the character, so you wouldn’t have to copy the code for each variant you just draw it over the hitbox which has all the logic.

2 Likes