How do I lock degrees per rotation?

Get help using Construct 2

Post » Thu Jan 22, 2015 2:41 am

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?
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Thu Jan 22, 2015 7:02 pm

Nobody?

Oh well, guess it's time to test some theories.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Sun Feb 08, 2015 4:32 am

I would like to know how you solved this, if you ever managed to.
B
8
Posts: 26
Reputation: 348

Post » Tue Feb 10, 2015 9:08 pm

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.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407


Return to How do I....?

Who is online

Users browsing this forum: Davlin, Madave96 and 6 guests