Maximum rotation

For questions about using Classic.

Post » Sat Apr 07, 2012 3:07 pm

Hello guys, I'm new here, but I know Construct Classic since 3 months,

So, I'm actually doing some tests, with the "platformer" of Construct Classic, I have a player that's divided in 3 parts: body, arms, legs, so the "arms" follow the cursor but they follow everywhere... So I've a question:

-How to block the rotation in a certain value ?

I mean, I want to block the arm rotation when the cursor is on the sky, so that the player can't rotate completely (360).

Like this:


Thanks for your help.TopsyKretts2012-04-07 15:10:02
B
4
Posts: 20
Reputation: 365

Post » Sat Apr 07, 2012 3:23 pm

Ordinarily you would use clamp(angle,lowangle, highangle), but that wont work as you would have zero in between low and high, and it would go clockwise, rather than what you want.
A work around would be to change the image angle so that what you see is offset by your limits. You should be able to do that in the image editor.
So rather than have clamp(angle, 45,315), you would use clamp(angle,0,90).
Keep in mind that is only for when facing right, you will need another image, and new rules for facing left.
Changing frames of the image should solve that.newt2012-04-07 15:25:31
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Apr 07, 2012 7:35 pm

Err...
You mean like that:



?
B
4
Posts: 20
Reputation: 365

Post » Sat Apr 07, 2012 8:50 pm

The big help was in my image, but I don't saw it...:


The solution is pretty stupid but it's works for me.

TopsyKretts2012-04-07 21:02:31
B
4
Posts: 20
Reputation: 365

Post » Sat Apr 07, 2012 10:36 pm

Whatever works for you.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Apr 07, 2012 11:52 pm

Thanks for your help anyway ! :)
B
4
Posts: 20
Reputation: 365


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests