» Uncategorized Posts

get_player_hud_color

Returns the hex value of the specified player’s HUD color.

ArgumentTypeDescription
player:realThe player slot to check. Should be between 1 and 4.

Example, called from update.gml:

//This code changes the player's outline to the same color as their HUD.
var _col = get_player_hud_color( player );
outline_color = [
color_get_red( _col ),
color_get_green( _col ),
color_get_blue( _col )
];

is_player_on

Checks whether the player slot is active or not.

ArgumentTypeDescription
setting:realThe player slot to check. Must be between 1 and 4.

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

//This code adds to a total player count in obj_stage_main for every active player in the match.
if ( player_is_on( player ) ) {
other.total_player_count += 1;
}

is_special_pressed

Returns whether the special button is pressed while also taking the right stick into account if it’s set to Special.

ArgumentTypeDescription
dir:realThe direction to check.

Indexes Reference

Example, called from attack_update.gml:

//This code triggers another attack if the player inputs a DSPECIAL during a certain portion of USPECIAL.
if ( attack == AT_USPECIAL && window == 4 && is_special_pressed( DIR_DOWN ) ) {
set_attack( AT_USPECIAL_2 );
}

get_marker_y

Returns the Y position of a specified stage marker. Will return -1 if the marker is not found.

ArgumentTypeDescription
index:realThe index of the stage marker to find.

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

//This code will destroy the article as soon as it goes below the specified marker.
if ( y >= get_marker_y( 6 ) ) {
instance_destroy();
}

get_marker_x

Returns the X position of a specified stage marker. Will return -1 if the marker is not found.

ArgumentTypeDescription
index:realThe index of the marker to find.

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

//This will destroy the article as soon as it goes to the left of a specific marker.
if ( x <= get_marker_x( 6 ) ) {
instance_destroy();
}