» Uncategorized Posts

get_instance_y

Returns the y value of the specified instance. Used for referencing objects that you normally don’t have access to.

ArgumentTypeDescription
instance_id:realThe ID of the instance to get the y value of

Example, called from article1_update.gml:

// destroys the article when it’s within Clairen’s plasma field:
with (asset_get( "plasma_field_obj" )) {
with (other.id) {
if (point_distance(
x + 10 * spr_dir,
y,
get_instance_x( other ),
get_instance_y( other )
) < 180) {
instance_destroy();
}
}
}

get_instance_x

Returns the x value of the specified instance. Used for referencing objects that you normally don’t have access to.

ArgumentTypeDescription
instance_id:realThe ID of the instance to get the x value of

Example, called from article1_update.gml:

// destroys the article when it’s within Clairen’s plasma field:
with (asset_get( "plasma_field_obj" )) {
with (other.id) {
if (point_distance(
x + 10 * spr_dir,
y,
get_instance_x( other ),
get_instance_y( other )
) < 180) {
instance_destroy();
}
}
}

set_victory_bg

Overwrites character’s victory background. Can be assigned to a 480x270px custom sprite using

sprite_get( sprite )  Reference→

or set to one of the following indexes

ArgumentTypeDescription
bg:realVictory background index or custom sprite ID

Example, called from load.gml:

set_victory_bg( sprite_get( "custom" ));

get_stage_data

Returns the size of the specified part of the stage.

ArgumentTypeDescription
index:realThe data to get

Indexes Reference

Example, called from update.gml:

// // keeps track of how long the player is offstage:
var stage_x = get_stage_data( SD_X_POS );
if (x < stage_x || x > room_width - stage_x){
offstage_timer++;
} else {
offstage_timer = 0;
}

get_game_timer

Returns the number of frames remaining in the match.

Example, called from hit_player.gml:

// this character deals extra knockback in the last minute of a match:
if (get_game_timer() < 60 * 60) { // there are 60 frames in one second
hit_player_obj.old_hsp *= 1.2;
hit_player.obj.old_vsp *= 1.2;
}