• Register
Post news RSS Freedom - Ghost Dash

This is a sample dash effect that I wanted to share! It does not end until you set the dash timer to 0 or use a toggle to change when to use the effect!

Posted by on

Freedom 2022 06 18 13 15 56 conv


Object needing the dash effect:

Create:

// timer you pass into the dash effect function

dash_timer = 0;

// The amount of time in frames to know how long until creating another effect

time_for_effect = 10;

Step:

++dash_timer;

create_new_dash(time_for_effect);

create_new_dash function:

// This function will take the dash time, and when the dash timer is a multiple of the time for effect, create a dash effect

// White is the default color and displays the sprite normally

function create_new_dash(time, cols = c_white) {

if (dash_timer mod time == 0) {

// Can also use a with statement

var dash = instance_create_layer(x, y, "Instances", obj_dash_effect);

dash.sprite_index = sprite_index;

dash.image_index = image_index;

dash.image_angle = image_angle;

dash.image_blend = cols;

}

}

Dash effect object (obj_dash_effect):

Create:

image_alpha = .8;

fade_amount = .05;

Step:

// Fade out as long as the image alpha is above 0

if (image_alpha > 0) {

image_alpha -= inc;

} else {

instance_destroy();

}

Freedom 2022 06 18 13 15 56 conv 1

Freedom 2022 06 18 13 15 56 conv 2


Available at: itch.io, moddb.com, indiedb.com, and the official website!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.