» Uncategorized Posts

shake_camera

Sets the camera shake.

ArgumentTypeDescription
intensity:realThe intensity of the camera shake
time:realThe time it should shake for, in frames

Note that this will override any other camera shake currently happening.

Example, called from update.gml:

//Makes the camera shake for 6 frames when the player lands.
if (state == PS_LAND or state == PS_LANDING_LAG) && state_timer == 1 {
shake_camera( 8, 6 )
}

get_player_name

Returns the name being currently used by the specified player, returning “P1”, “P2”, etc. if the player has no name set.

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

Example, called from post_draw.gml:

// This draws the current player name as debug text under the character:
draw_debug_text(x, y+10, get_player_name( player ));

get_kb_formula

Returns the resulting amount of knockback a player would get if they were hit with the specified stats. Usually used in tandem with get_hitbox_angle()  Reference→

ArgumentTypeDescription
player damage:realThe current damage of the target before being hit
player knockback_adj:realThe target's knockback multiplier, usually under knockback_adj
KB mulitplier:realThe general KB multiplier, usually defined by match settings
hitbox damage:realThe amount of damage the hitbox deals
hitbox BKB:realThe hitbox's base knockback value
hitbox KB scale:realThe hitbox's knockback scaling

Example, called from article1_hit.gml:

// This simulates knockback in an article as if it were a player, to be used elsewhere:
orig_knock = get_kb_formula(damage, knockback_adj, 1.0, enemy_hitboxID.damage, enemy_hitboxID.kb_value, enemy_hitboxID.kb_scale);

get_hitstop_formula

Returns the resulting amount of hitpause a player would get if they were hit with the specified stats. Note that hitpause is not hitstun; hitpause is the freezeframes immediately after getting hit.

ArgumentTypeDescription
player damage:realThe current damage of the target before being hit
hitbox damage:realThe amount of damage the hitbox deals
hitbox base hitstop:realThe base hitpause the hitbox always deals
hitbox hitstop scale:realThe amount hitpause scales with damage
hitbox extra hitpause:realThe extra hitpause only dealt to the target

Example, called from article1_hit.gml:

// This simulates hitpause in an article as if it were a player, to be used elsewhere:
hitstop = get_hitstop_formula(damage, enemy_hitboxID.damage, enemy_hitboxID.hitpause, enemy_hitboxID.hitpause_growth, enemy_hitboxID.extra_hitpause);

get_synced_var

Returns the persistent global variable of that player slot.

ArgumentTypeDescription
player:realID of the player to get the synced variable of

Example, called from init.gml:

// This character gets a slower dash speed and higher jump if something has changed its synced variable to 1 before the match starts, likely as a custom menu option:
if (get_synced_var( player ) == 1) {
dash_speed -= 2;
jump_speed += 3;
}