» Uncategorized Posts

get_hitbox_angle

Returns the angle that the hitbox sends. The function takes the current object’s position into account for angle flippers.

ArgumentTypeDescription
hitbox_id:realThe ID of the hitbox to get the angle of

Example, called from article1_update.gml:

// this non-player object has a custom KB formula when hit by a hitbox:
var temp_angle = get_hitbox_angle( enemy_hitboxID );
var force = enemy_hitboxID.kb_value + enemy_hitboxID.kb_scale * 12;
hsp = lengthdir_x( force, temp_angle );
vsp = lengthdir_y( force, temp_angle );

destroy_hitboxes

Destroys all physical hitboxes for the character.

Example, called from attack_update.gml:

// in this example, window 2 is a diving attack with a long-lasting hitbox that goes away when landing into window 3:
if (window == 2 && !free){
window = 3;
window_timer = 0;
destroy_hitboxes();
}

reset_num_hitboxes

Resets the number of hitboxes for the specified attack to the one originally initialized in [attack_name].gml.

ArgumentTypeDescription
attack:realThe attack to reset the hitbox number of

Example, called from attack_update.gml:

// resets the number of dstrong hitboxes to the value in dstrong.gml:
reset_num_hitboxes( AT_DSTRONG );

set_num_hitboxes

Overwrites the number of hitboxes for the specified attack.

ArgumentTypeDescription
attack:realThe attack to set the hitbox number of
value:realThe value to set

Example, called from dstrong.gml:

// sets the number of hitboxes for dstrong attack:
set_num_hitboxes( AT_DSTRONG, 3 );

get_num_hitboxes

Returns the number of hitboxes for the specified attack.

ArgumentTypeDescription
attack:realThe attack to get the hitbox number for

Example, called from post_draw.gml:

// draws the number of hitboxes for your current attack:
draw_debug_text( x, y, get_num_hitboxes( attack ));