How do I determine if an object has fully rotated

Get help using Construct 2

Post » 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

Post » 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
33
G
47
Posts: 1,194
Reputation: 30,782

Post » 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

Post » 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
51
S
23
G
15
Posts: 273
Reputation: 11,538


Return to How do I....?

Who is online

Users browsing this forum: alajajm, LaurenceBedford, tetuan and 11 guests