# Dash help please

**URL:** https://forum.makecode.com/t/dash-help-please/13213
**Category:** Help
**Created:** [April 22, 2022, 12:01am UTC](https://forum.makecode.com/t/dash-help-please/13213 "2022-04-22T00:01:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [April 22, 2022, 12:01am UTC](https://forum.makecode.com/t/dash-help-please/13213/1 "2022-04-22T00:01:08Z")

</div>

> **[DaSh-R](https://arcade.makecode.com/90750-75596-72663-81355)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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?

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [April 22, 2022, 9:28pm UTC](https://forum.makecode.com/t/dash-help-please/13213/2 "2022-04-22T21:28:17Z")

</div>

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:

> **[DaSh-R fixed](https://arcade.makecode.com/37146-50987-56088-94595)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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

---

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [April 25, 2022, 5:18pm UTC](https://forum.makecode.com/t/dash-help-please/13213/3 "2022-04-25T17:18:57Z")

</div>

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:

> **[DaSh](https://arcade.makecode.com/62853-10474-63953-73340)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![InvalidProject](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/invalidproject/32/32554_2.png) [@InvalidProject](https://forum.makecode.com/u/InvalidProject)
#### Post date: [April 25, 2022, 5:20pm UTC](https://forum.makecode.com/t/dash-help-please/13213/4 "2022-04-25T17:20:07Z")

</div>

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](https://makecode.com/_LJ9bcC2cJiUL)

---

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [April 25, 2022, 8:06pm UTC](https://forum.makecode.com/t/dash-help-please/13213/5 "2022-04-25T20:06:51Z")

</div>

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
