# Forward/Back Jumping for a fighting game

**URL:** <https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002>\
**Category:** Help\
**Tags:** game\
**Created:** [May 30, 2025, 2:30pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002 "2025-05-30T14:30:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingbap](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bingbap/32/23345_2.png) [@bingbap](https://forum.makecode.com/u/bingbap)\
**Post date:** [May 30, 2025, 2:30pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/1 "2025-05-30T14:30:32Z")

</div>

G’day mates! First ever post here, let me know if I’m doing something wrong.

I’m working on the basis of a fighting game, but I can’t seem to figure out one crucial detail.  
I want to have my characters jump forwards/backwards a certain distance, but can’t have them moving freely in the air (see image)

 ![Core-A Gaming - Every Fighting Game Type Explained b4Kc1p6Iat8 - 866x487 - 4m22s](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/a/0ae8e81724fc48fb8b404f5b7e139ad118203c0e.png)

Any help and ideas would be appreciated. [https://arcade.makecode.com/S71415-87799-93899-37778](https://arcade.makecode.com/S71415-87799-93899-37778)

---

<div class="post-metadata">

**Author:** ![Fixitude](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fixitude/32/28576_2.png) [@Fixitude](https://forum.makecode.com/u/Fixitude)\
**Post date:** [May 30, 2025, 9:12pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/2 "2025-05-30T21:12:02Z")

</div>

My suggestion (and this is slightly complicated) is to use sprite utils and set an angle every 400 ms or something to the point where you want to go then change the degree by one or two or something every second so it arks?

---

<div class="post-metadata">

**Author:** ![bingbap](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bingbap/32/23345_2.png) [@bingbap](https://forum.makecode.com/u/bingbap)\
**Post date:** [May 30, 2025, 10:47pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/3 "2025-05-30T22:47:24Z")

</div>

Do you have the link to the sprite util extension? I can’t seem to find it.

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 31, 2025, 1:42pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/4 "2025-05-31T13:42:49Z")

</div>

Ok. If you are using that block “Control (sprite) with buttons” you can set it to the speed 0,0 and it will prevent the player from controlling the sprite. In this way, you can stop movement in the air until the player sprite is “hitting wall [down]” and then give them control back. If you are using custom movement scripts, I don’t see why you can’t stop them from moving while they aren’t touching the ground, should be simple enough. If you are confused about gravity and the like, you can use the “acceleration y” attribute to give your sprites gravity, and then set their velocity Y and X to a certain value when they jump, which will make sure the jump is the same each time.

---

<div class="post-metadata">

**Author:** ![Fixitude](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fixitude/32/28576_2.png) [@Fixitude](https://forum.makecode.com/u/Fixitude)\
**Post date:** [May 31, 2025, 1:55pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/5 "2025-05-31T13:55:15Z")

</div>

Here is the link for the sprite utils, [https://github.com/jwunderl/arcade-sprite-util.git](https://github.com/jwunderl/arcade-sprite-util.git), paste that into the extensions url code then try it out.

---

<div class="post-metadata">

**Author:** ![bingbap](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bingbap/32/23345_2.png) [@bingbap](https://forum.makecode.com/u/bingbap)\
**Post date:** [June 1, 2025, 6:00pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/6 "2025-06-01T18:00:57Z")

</div>

I’m trying that out now, it seems to be working.

For reference, which direction is 0 degrees at?

---

<div class="post-metadata">

**Author:** ![Tsist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/tsist/32/20588_2.png) [@Tsist](https://forum.makecode.com/u/Tsist)\
**Post date:** [June 2, 2025, 2:51pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/7 "2025-06-02T14:51:38Z")

</div>

0° is at the right  
degrees go clockwise.

---

<div class="post-metadata">

**Author:** ![swirlix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/swirlix/32/35624_2.png) [@swirlix](https://forum.makecode.com/u/swirlix)\
**Post date:** [June 2, 2025, 2:54pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/8 "2025-06-02T14:54:45Z")

</div>

it is based off of radians instead of degrees, but I don’t know what direction 0 is sorry. I just wanted to let you know because when I used it I was **very** confused.

---

<div class="post-metadata">

**Author:** ![Fixitude](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fixitude/32/28576_2.png) [@Fixitude](https://forum.makecode.com/u/Fixitude)\
**Post date:** [June 2, 2025, 2:59pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/9 "2025-06-02T14:59:17Z")

</div>

Check if you are using radians or degrees, if it is radians you will need to convert the amount+ 90 degrees to radians.

---

<div class="post-metadata">

**Author:** ![bingbap](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bingbap/32/23345_2.png) [@bingbap](https://forum.makecode.com/u/bingbap)\
**Post date:** [June 3, 2025, 2:49am UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/10 "2025-06-03T02:49:01Z")

</div>

I have updated the code so that the jumping script works as intended to some extent.

However, I need to increase the horizontal distance by changing the angle.

> **[it kinda works](https://arcade.makecode.com/S52860-42050-21213-90215)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Any ideas would be helpful

---

<div class="post-metadata">

**Author:** ![ARandomGuyOnMakeCode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/arandomguyonmakecode/32/22983_2.png) [@ARandomGuyOnMakeCode](https://forum.makecode.com/u/ARandomGuyOnMakeCode)\
**Post date:** [June 3, 2025, 6:46pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/11 "2025-06-03T18:46:02Z")

</div>

You know, instead of using velocity, you could just use a [Bézier curve](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to imitate a jump. That would prevent the player from moving and would have the added benefit of giving you more control with how high the player jumps and where they land. I could make a kind of demo to demonstrate if you want.

---

<div class="post-metadata">

**Author:** ![bingbap](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bingbap/32/23345_2.png) [@bingbap](https://forum.makecode.com/u/bingbap)\
**Post date:** [June 6, 2025, 4:52pm UTC](https://forum.makecode.com/t/forward-back-jumping-for-a-fighting-game/37002/12 "2025-06-06T16:52:19Z")

</div>

Yes, that would be very helpful.
