» Uncategorized Posts

hit_fx_create

Creates a visual effect to be used with your custom character. Returns the index of visual effect, to be stored for later use. This function permanently stores the data of the visual effect, so be sure to only call it once per effect, not anywhere that runs every frame (like update.gml).

Use either

asset_get( sprite )  Reference→
sprite_get( sprite )  Reference→

to retrieve the sprite ID.

ArgumentTypeDescription
sprite_index:realThe ID of the sprite to be used as a visual effect
animation_length:realThe length of the effect animation, in frames

Example, called from init.gml:

// creates a 30 frame explosion effect:
cool_effect = hit_fx_create( sprite_get( "cool_explosion" ), 30 );

Then in dspecial.gml:

// assigns the explosion effect to dspecial:
set_hitbox_value( AT_DSPECIAL, 1, HG_VISUAL_EFFECT, cool_effect );

You can also manually spawn the effect from, say, update.gml:

// spawns the custom effect at the specified position:
spawn_hit_fx( x, y, cool_effect );

can_tap_jump

Used in combination with tap_jump_pressed to check if tap jump is pressed.

Example, called from attack_update.gml:

// window 3 transitions into window 4 when pressing jump:
if (window == 3 && (jump_pressed || (tap_jump_pressed && can_tap_jump() ))){
window = 4;
window_timer = 0;
}

clear_button_buffer

Clears the input buffer for the specified action.

ArgumentTypeDescription
input_index:realThe input buffer to clear

Indexes Reference

Example, called from atack_update.gml:

// allows the attack to cancel immediately into the aerial idle state using the shield button without buffering an airdodge:
if (window == 2 && shield_pressed) {
set_state( PS_IDLE_AIR );
clear_button_buffer( PC_SHIELD_PRESSED );
}

iasa_script

Frees up the character to perform any action.

Example, called from attack_update.gml:

// this attack is cancellable on hit:
if (window == 3 && has_hit){
iasa_script();
}

set_attack

Changes the character’s state to the specified attack.

ArgumentTypeDescription
state:realThe attack to set

Example, called from attack_update.gml:

// allows the player to cancel the endlag of a successful parry into Nspecial (but not other specials):
if (state == PS_PARRY && window == 2 && perfect_dodged && special_pressed) {
if !(up_down || down_down || left_down || right_down) {
set_attack( AT_NSPECIAL );
}
}