» Uncategorized Posts

music_stop

When called in a stage article, stops the current background music track.

Example, called from a stage’s update.gml:

// instantly stop music:
music_stop();

music_play_file

When called in a stage article, plays a background music track which replaces the currently playing music track.

ArgumentTypeDescription
file:stringThe file to load located in the /sounds directory.

Example, called from a stage’s update.gml:

// plays "my_song.ogg" located in the /sounds directory:
music_play_file( "my_song" );

create_deathbox

Creates a hitbox that instantly K.O.s any player that touches it.

ArgumentTypeDescription
x:realThe x coordinate of the center of the deathbox's desired position
y:realThe y coordinate of the center of the deathbox's desired position
w:realThe width of the deathbox, in pixels
h:realThe height of the deathbox, in pixels
player:realUsed to make the deathbox only hit a specific player.
Set to -1 if you want it to be able to hit all players.
Set to 0 if you want it to be able to hit all players except yourself
free:realIf set to false, it will only hit grounded players
shape:realThe sprite to use for the deathbox (same as the HG_SHAPE property in the hitbox grid):
0 = circle
1 = rectangle
2 = rounded rectangle
lifespan:realThe number of frames the deathbox stays active
bg_type:real[optional]
The screen effect to play when the deathbox hits someone:
0 = no screen effect
1 = purple screen effect
2 = red screen effect

Example, called from attack_update.gml:

// this attack creates a deathbox on top of the player that was hit by an earlier hitbox of the attack. This deathbox can only kill the hit player and will show the red screen effect on hit:
if (window == 3 && window_timer == 10 && has_hit_player) {
create_deathbox(
has_hit_id.x, // x
has_hit_id.y, // y
100, // w
100, // h
has_hit_id.player, // player
true, // free
1, // shape
3, // lifespan
2 // bg_type
);
}

create_hitbox

Creates a hitbox at (x, y) pulling from the attack data of the specified hitbox.

ArgumentTypeDescription
attack:realThe attack to get the hitbox data from
hitbox_num:realThe index of the hitbox to get the data from
x:realThe x coordinate to create the hitbox at
y:realThe y coordinate to create the hitbox at

Example, called from article1_update.gml:

// this article creates a hitbox (the owner's 1st Dspecial hitbox) any time it's close to its owner:
if (point_distance( x, y, owner.x, owner.y ) < 32 && cooldown_timer == 0) { create_hitbox( AT_DSPECIAL, 1, x, y - 40 );
cooldown_timer = 60;
}

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 );