• Register

The almost frustrating game to free you from your boredom! - Made with love, lots of pizza, and strawberry ice cream! Freedom is a minimalist platformer set in a somewhat colorful world gripped by a struggle.

Post news Report 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

Your comment will be anonymous unless you join the community. Or sign in with your social account: