We only need a single pixel because we are going to scale it to whatever size we need whenever we instantiate a hurtbox. Create a new sprite, name it sprHurtbox, make it just a single pixel, and color it green.
If Makoto were to touch someone else's hurtbox with her hitbox, the other player would be 'hit.'įirst, we need a sprite for our hurtbox. The red rectangle is the hitbox of the attack, while the green rectangle is the hurtbox. This is an upward-angled punch used as an anti-air attack, hitting an opponent that is jumping at you. Here we see Makoto performing one of her special moves, Fukiage. See the example below from Ultra Street Fighter IV. In my opinion, fighting games offer the clearest examples of hitboxes and hurtboxes.
I am going to be using fighting games as the main example for this entry. Whenever the two collide, we consider the attack to have 'landed' and we apply its effect on the target. A hurtbox is usually associated with a character (or any other 'hittable' object in your game). A hitbox is usually associated with some form of attack, and describes where that attack is effective. Hitboxes and hurtboxes are specialized collision checks (collision checks allow you to determine when objects come in contact or overlap). Written in October 2017 by Nathan Ranney, the founder of game development studio Gutter Arcade.