How do I rotate a sprite exactly one time.

Just started using Construct 2? Post your questions here

Post » Thu Dec 22, 2016 5:05 pm

I know I'm missing something simple but I can't get it to work correctly.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Thu Dec 22, 2016 5:25 pm

There might be an easier way but if I had to do it I would just rotate it clockwise 1 degree every tick and then toggle it off when it comes back round to 360.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Thu Dec 22, 2016 5:33 pm

That's what I was trying but it isn't exact (the sprite ends up slightly off depending on how the ticks fall). I thought about adding a variable and after the rotation is done just setting it back to 360 degrees so it looks correct, but I thought there might be something better (simple) that I didn't think of.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Thu Dec 22, 2016 5:40 pm

Yeah on my toggle off event I have 'is between 359 and 360 degrees.' It then stops at 359.9999. But you can of course add an event there to set it exactly to 360 on the toggle off.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Thu Dec 22, 2016 9:34 pm

B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346

Post » Thu Dec 22, 2016 9:44 pm

Thank you. :) That's a bit more code then I wanted to use, but I'm sure it will help somebody in the future. I was able to get the exact rotation to work by simply adding a variable as discussed above, but I then decided to scrap the rotating effect for something else. Thanks again though!
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest