8 directional beat em up movement

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Don't get me wrong, i tried a lot, spent many hours to find it on forums, YT, Reddit etc. but still can't find a proper solution. I'm talking about accurate 8 directions movement without doubling up speed on diagonals.

  • Why would the speed double up with diagonal movement? Are you using a fast loop?

    The soul of the sluggard craves and gets nothing, while the soul of the diligent is richly supplied -Pro 13:4

  • Hi ^^
    I think, if you don't want a speed change, you can have an object with some values like :
    FloatX, FloatY, Direction, Speed
    The direction could represent your angle, on a 8 direction each direction is a multiple of 45°, with that, when your speed is greater than 0 you can do :
    FloatX = FloatX + (cos(Direction)*Speed)
    FloatY = FloatY + (0-(sin(Direction)*Speed))

    If you use 0 to 7 instead of angle for direction this become :
    FloatX = FloatX + (cos(Direction*45)*Speed)
    FloatY = FloatY + (0-(sin(Direction*45)*Speed))

    After that you can add an event that set X to FloatX and Y to FloatY, this way you keep a constant speed in each direction ^^

    Edit : I just saw that the thread you gave use this method, but, with sin()*speed and cos()*speed, this should not have speed change ^^'. You can take a look at parametric equation of a circle, I think this is the kind of calcul that is commonly use for Shoot Them Up for exemple ( to make 360° projectils ) ^^

    Edited 3 times, last by Sleepy (July 3, 2020 at 1:57 AM).

  • Here's an 8 direction example someone made for me a long time ago. It uses the Physics Engine and is 8 directions with same speed on diagonal movement.

    Please login to see this attachment.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!