» Uncategorized Posts

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

get_gameplay_time

Returns the number of frames since the match started.

Example, called from post_draw.gml:

// draws a fire sprite on top of the player that animates at 10 frames per second. Using the gameplay timer as a base for the fire's image index allows it to animate at a consistent speed without creating a new local variable on the player:
if (on_fire) {
var fire_image = get_gameplay_time() / 6;
draw_sprite( fire_sprite, fire_image, x, y );
}

spawn_hit_fx

Spawns a visual effect at the specified position.

ArgumentTypeDescription
x:realThe x position to spawn effect at
y:realThe y position to spawn effect at
hit_fx_index:realThe ID of a built-in visual effect or a custom effect previously created with hit_fx_create( sprite_index, animation_length ) Reference→

Example, called from update.gml:

// spawns a visual effect at the beginning of 4th Fspecial window:
if (attack == AT_FSPECIAL && window == 4 && window_timer == 1) {
spawn_hit_fx( x, y, my_custom_hit_fx );
}