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();
By flashy — February 2, 2019
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();
By flashy — February 2, 2019
When called in a stage article, plays a background music track which replaces the currently playing music track.
Argument | Type | Description |
---|---|---|
file | :string | The 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" );
By George — February 11, 2018
Creates a hitbox that instantly K.O.s any player that touches it.
Argument | Type | Description |
---|---|---|
x | :real | The x coordinate of the center of the deathbox's desired position |
y | :real | The y coordinate of the center of the deathbox's desired position |
w | :real | The width of the deathbox, in pixels |
h | :real | The height of the deathbox, in pixels |
player | :real | Used 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 | :real | If set to false, it will only hit grounded players |
shape | :real | The sprite to use for the deathbox (same as the HG_SHAPE property in the hitbox grid): 0 = circle 1 = rectangle 2 = rounded rectangle |
lifespan | :real | The 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
);
}
By George — February 11, 2018
Creates a hitbox at (x, y) pulling from the attack data of the specified hitbox.
Argument | Type | Description |
---|---|---|
attack | :real | The attack to get the hitbox data from |
hitbox_num | :real | The index of the hitbox to get the data from |
x | :real | The x coordinate to create the hitbox at |
y | :real | The 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;
}
By George — February 11, 2018
Returns the angle that the hitbox sends. The function takes the current object’s position into account for angle flippers.
Argument | Type | Description |
---|---|---|
hitbox_id | :real | The 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 );