How do I lock degrees per rotation?

0 favourites
  • 4 posts
From the Asset Store
Per Pixel Destruction like in "Worms" (perfect performance, no third party plugins)
  • Okay, so I feel like I'm overthinking this issue and overlooking a simple solution, so wanted to ask before I commit to writing any unnecessary code.

    How do I limit the number of degrees an object can rotate, per rotation? Effectively, how do I limit the number of angles an object can face and move in? I'm trying to use the Pathfinding behavior with a sprite that's only supposed to be able to face 16 directions, but while making the animations correspond to the general angle was simple enough, movement can look a little odd since Pathfinding uses a full 360 degrees of rotation. How can I limit it to 22.5 degree increments so as to make the movement and animation flow together more smoothly?

  • Nobody?

    Oh well, guess it's time to test some theories.

  • I would like to know how you solved this, if you ever managed to.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My attempts didn't get far unfortunately, but luckily enough the pathfinding generally only moves along 8 directions to begin with (horizontals, verticals, and diagonals), so as long as the turn speed was high enough it looked okay. I did end up increasing the sprite's direction count from 16 to 32 to make it smoother, however.

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