The Daily Click ::. Forums ::. Klik Coding Help ::. Weird rotation bug

Post Reply  Post Oekaki 

Posted By Message


11th June, 2009 at 06:30:14 -

Well here's a strange bug I haven't seen before.

I have, say, 50 objects arranged on the playfield. When I press right, I want them to rotate 90 degrees around a centre point, and go the opposite way when I press left. It sounds simple enough.

Alterable Value B is the current offset angle
Alterable Value C is the target offset angle
Alterable Value D is the distance from the origin

Set X to Sin(Alterable Value B)*Alterable Value D
Set Y to Cos(Alterable Value B)*Alterable Value D

On key "right":
Add 90 to Alterable Value C

Alterable Value B < Alterable Value C:
Add 10 to Alterable Value B

But what actually happens is that they all rotate one after the other instead of all at once. I just encountered this bug so I'll try again with a new file. Has anyone else experienced anything like this?


Don Luciano

Heavy combat pancake


VIP Member
11th June, 2009 at 11:59:14 -

Oh forget it, i misunderstood.

Edited by Don Luciano

Code me a sausage!

Post Reply



Worth A Click