» Uncategorized Posts

set_attack_value

Overwrites a value from the attack grid for the specified attack and index. Default values are always 0.

ArgumentTypeDescription
attack:realThe attack to set the value of
index:realThe index of the attack grid to set the value of
value:realThe value to set

Example, called from jab.gml:

// sets the sprite of a jab attack to a custom sprite named "jab":
set_attack_value( AT_JAB, AG_SPRITE, sprite_get ( "jab" ) );

get_attack_value

Returns a value (real or undefined) from the attack grid for the specified attack and index.

ArgumentTypeDescription
attack:realThe attack to get the value of
index:realThe index of the attack grid to get the value of

Example, called from attack_update.gml:

// gives the character super armor during the final window of the attack:
if (window == get_attack_value( attack, AG_NUM_WINDOWS ) ) {
super_armor = true;
}

init_shader

Refreshes the character’s shader values. If you change any of their shader colors (including outline color), you must call this to tell the game the values have changed.

Example, called from update.gml:

// set the character's outline color to red:
outline_color = [ 255, 0, 0 ];
// tell the shader to update the character's colors:
init_shader();
// set the character's outline color back to black, but don't tell the shader that you changed it. This way, if the character action is interrupted before you can manually set the outline color back to black, it will still change back:
outline_color = [ 0, 0, 0 ];

shader_end

Used in combination with

shader_start()  Reference→

at the beginning of draw scripts to recolor the following draw calls according to the character’s color profile.

Example, called from post_draw.gml:

// draws a hat that is recolored by the shader:
shader_start();
draw_sprite_ext( sprite_get( "cool_hat" ), hat_image_index, x, y );
shader_end();

shader_start

Used at the beginning of draw scripts to recolor the following draw calls according to the character’s color profile. Must be followed by shader_end()  Reference→

Example, called from post_draw.gml:

// draws a hat that is recolored by the shader:
shader_start();
draw_sprite_ext( sprite_get( "cool_hat" ), hat_image_index, x, y );
shader_end();