between angles not behaving correctly

Not favoritedFavorited Favorited 0 favourites
  • 11 posts
From the Asset Store
3D Car Pack 1
$2.99 USD
3D models + Rendered Low-Poly Cars in isometric, top-down, and side angles.
  • im trying to make a top down doom game and when the angle turns of the player its sprite should play and animation depending on the angles for example the angle is bet ween 315 and 45 its gonna play the angle of the player angle 0 idle. im testing it but whenever it turns like continiously it often skips the animations. the file by the way

    drive.google.com/file/d/1sZ_yOQz5DjroSOAShUXQuT7oI_i4Mn5M/view

  • The angle ranges you’re checking are overlapping. That would explain the skipping. Probably making the angle ranges not overlap would fix it.

  • how? what does that mean how do i do it. also i specifically mean the 180 angle sprite one thats the one i saw really often but i want to make sure every one of them are good

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Consider the first two ranges 315 to 45 and 0 to 90. They are overlapping by 45 degrees. And all of your ranges overlap similarly.

    Those should be 0-45/2 to 0+45/2 and 45-45/2 to 45+45/2 and so on. Notice the pattern? You could also use the condition angle is within 45/2 degrees of 0.

  • so just add a /2 to every first angle?

  • If visuals help you could draw a circle cut into 8 slices like a pizza and measure angles of the edges.

    Otherwise I’ll just defer to suggestions of others.

    Again it looks like the angle ranges you’re using are overlapping each other which makes it seem like things are being skipped. You need to reduce the angle ranges so they don’t overlap.

  • You can do like this and remove conditional event for the animation:

    Just in case: dropbox.com/scl/fi/o0vegcufod85s023kck1m/DoomGuy-simplified.capx

  • no dont like that code. any other simple ways? i asked question just to add /2 and nobody answered yes or no

  • okay sorry i dont like that code cause i need to add alot more animations like running and shooting instead i will make a variable for what angle it is and for every angle its gonna play that angle of animations.

  • You’ll probably have to restate the question. And no, just adding /2 isn’t what I was suggesting.

    What alexto suggested is elegant imo. It reduces all those events down to one event. And anything can be modified to meet other requirements you may have later. We generally reply with ideas that ideally you can then use or maybe modify to be useful for you.

    I don’t get the idea that formulas are your thing. I mean we all are at different levels. So here’s one last attempt.

    315 to 45 should be -22.5 to 22.5

    0 to 90 should be 22.5 to 67.5

    45 to 135 should be 67.5 to 112.5

    … and so on

    Notice the pattern? Where one range stops the next one starts so there is no overlap and no directions will seem to be skipped.

    I’ll leave it to you to find the other ranges but you can calculate them with:

    a-45/2 to a+45/2

    Alexto’s formula rounds an angle to the nearest 45 and combines it with an animation lookup. That’s super useful to simplify things.

    The meat of it is round(a/45)*45 which rounds to the nearest 45.

    And sure he wrote it for one animation type but it should be trivial to use the same idea for other animation types.

    Anyways, that’s should get you some ideas maybe. I don’t think I can give anything simpler that wouldn’t require a lot of extra work on my part.

  • thanks i fixxed it👍

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)