Forward/Back Jumping for a fighting game

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)

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

1 Like

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?

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

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.

1 Like

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

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

For reference, which direction is 0 degrees at?

0° is at the right
degrees go clockwise.

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.

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

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.

Any ideas would be helpful

1 Like

You know, instead of using velocity, you could just use a Bézier 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.

Yes, that would be very helpful.