Home - MichelVGameMaker/HitBoxes_gml GitHub Wiki

Welcome to the 'How To Use' HitBoxes_gml !

Hit-Boxes functions
Hurt Boxes functions

Configuration:

There are two macro you need to set to interface 'HitBoxes' with your code. They are located in the 'hitboxlib.gml' script asset under the section 'HitLib Options'.

  • #macro __HITLIB_DEFAULT_COLLIDER oColliderTest: the name of a Collider / Solid Parent Object. Children will bloc Hit Boxes.
  • #macro __HITBOX_DEFAULT_HURTABLE [oTarget_Par, oHurtbox]: the names of all 'Hurtable' Parent Objects. All their children will gain the ability to be hurt by Hit Boxes.

Usage:

There is no intialization function required. You can create Hit Boxes with hitbox_create() and then they are processed automatically.
For example,

  • hitbox_create(x, y, sprite_slash) will create an Hit Box that follows the calling instance (useful for a slash).
  • hurtbox_create(sBig_Square) will create an Hit Box that follows the calling instance and its angle/scales with the sBig_Square mask.

You need to manually detroy your Hit Boxes. The best approach is to set destroy_on_end or a destroy_timer, but this might not be convenient for projectiles.