» Uncategorized Posts

set_player_damage

Sets the amount of damage for the specified player.

ArgumentTypeDescription
player:realID of the player to set the damage of
value:realThe value to set

Example, called from attack_update.gml:

// fully heals your character at the end of window 2:
if (window == 2 && window_timer == 200) {
set_player_damage( player, 0 );
}

get_player_damage

Returns the amount of damage the specified player has.

ArgumentTypeDescription
player:realID of the player to get the damage of

Example, called from update.gml:

// this character has higher gravity when over 100%:
if (get_player_damage( player ) >= 100) {
gravity_speed = 1.0;
} else {
gravity_speed = 0.5;
}

get_player_color

Returns the color slot being currently used by the specified player.

ArgumentTypeDescription
player:realID of the player to get the color of

Example, called from post_draw.gml:

// this character's 3rd color slot has an aura drawn over it:
if (get_player_color( player ) == 3) {
draw_sprite(sprite_get( "aura_particles" ), aura_timer, x, y );
}

set_player_stocks

Sets the number of stocks for the specified player.

ArgumentTypeDescription
player:realID of the player to set the stocks of
value:realThe value to set

Example, called from attack_update.gml:

// gives your character another stock at the end of window 2:
if (window == 2 && window_timer == 200) {
set_player_stocks( player, get_player_stocks( player ) + 1 );
}

get_player_stocks

Returns the number of stocks the specified player has.

ArgumentTypeDescription
player:realID of the player to get the stocks of

Example, called from got_hit.gml:

// this character takes half knockback if the opponent has only 1 stock left:
if (get_player_stocks( hit_player ) == 1) {
old_hsp *= .5;
old_vsp *= .5;
}