Dash help please

I’m making a game that has my character dashing the direction it’s facing even if it is moving in a different way,
but I can’t get it to tp in said direction.
The goal of the dash is to get through things without getting hurt.
Can someone help?

1 Like

I don’t think using images to check movement direction is the best idea. You’d be better off making a variable that changes based on the direction and then derive the direction based on that. Perhaps an ‘increment_x’ and ‘increment_y’ variables. So then you set a default dash distance (let’s say 40 pixels, name it ‘distance’) and then when you press the A button you do
x = x + (increment_x * distance)
If you are not moving increment_x is 0 so 40 (distance) * 0 (increment_x) is 0 and you don’t dash any pixels. If you are moving towards the right, you set increment_x to 1 so 40 * 1 = 40 and you dash 40 pixels. When moving left you set increment_x to -1 so you go to the left. Same thing for going up and down on the y axis.
If you want your dash to be further, increase the value of the ‘distance’ variable, decrease it to make the dash shorter.
Here’s an implementation of that, feel free to take a look:

If you have any questions just ask, and I will try to help.

this is great
thank you
but I do want you to be able to dash the direction you facing so if you’re not moving you can still dash
here is a newer version of DaSh:

I tried to instead increase your speed for a short time, and I made a small level with checkpoints for you. https://makecode.com/_LJ9bcC2cJiUL

I like that a lot but I would like to have these things on the dash:
-cant change direction mid-dash
-Dash in the direction facing even if going a different way

ether way this is a big development
thank you