How do I rotate a block 180°

Get help using Construct 2

Post » Sun Oct 25, 2015 11:59 am

Hello,
i would like to know how can i rotate a block 180° everytime a press a key.

I can set the angle to 180°,but i want to see the block rotating.
I also tried the rotate behaviours but there is no controls on the angle.

Thanks
B
23
S
5
G
1
Posts: 40
Reputation: 1,281

Post » Sun Oct 25, 2015 1:25 pm

Try:

Global number rot = 0
Keyboard| On Space pressed -> System| add 180 to rot
Block| Invert(is clockwise from rot) -> Block| Rotate 1 degrees clockwise
System| rot >= 360 -> System set rot to 0

Invert means that you Invert 'is clockwise from'
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Sun Oct 25, 2015 2:07 pm

Thanks,that worked..

I just changed a line to this:
Block| Invert(is clockwise from rot) -> Block| Rotate 1 degrees towards Rot
to make it work perfectly
B
23
S
5
G
1
Posts: 40
Reputation: 1,281


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests