# How do I determine if an object has fully rotated

Get help using Construct 2

### » Tue Dec 01, 2015 1:26 am

I am creating a minigame similar to Osu's Spinner. Essentially, you have to rotate this object as much as possible in a given time frame, while keeping your mouse within certain bounds. The problem I'm having is calculating how many rotations there are. I was thinking of periodically adding values to an array, then testing each one to see if a difference is greater than 180 degrees. For each difference like this, I would add to a variable and use half of that number as my count, but it seems to convoluted and I'm sure I would mess something up.

Is there some sort of nice way to do this? Thanks in advance.
B
6
S
1
Posts: 8
Reputation: 643

### » Tue Dec 01, 2015 8:59 am

August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,912

### » Tue Dec 01, 2015 10:40 pm

Thanks, for anyone with the same problem in the future:

Create a variable which sets itself to the current angle every X seconds (currentAngle)
Then, every tick, add the following to a second variable (deltaAngle ):
angle(0,0,cos(currentAngle-Object.Angle),sin(currentAngle-Object.Angle))
B
6
S
1
Posts: 8
Reputation: 643

### » Wed Dec 02, 2015 12:37 am

Nice, bookmarking this for the near future. Thanks Weaselmon for sharing ur solution.
Brick by brick, stone by stone.
B
58
S
25
G
18
Posts: 273
Reputation: 13,413

### Who is online

Users browsing this forum: Zed2100 and 8 guests