PDA

View Full Version : rotation


felipe
06-28-2007, 10:17 PM
Every time I make a game that requires an object to rotate, it doesn't work. I always spend hours debugging and end up finding a unique algorithm for each problem. Can anybody help me get this straight? :confused:

Ferret
06-29-2007, 04:01 PM
I don't quite understand what you mean... Maybe you're thinking of the weird way things are rotated in flash. The right half of a circle goes (from the top to bottom) 0 to 180, like normal. Then the left side goes from 0 to -180. However, this shouldn't hinder you when writing something like mc._rotation = 270. It still works.

Also, maybe you have an off-centered mc. The movie clip rotates around the little haircross sign. So when you draw your movie clip, make sure where you want its point of rotation is on the haircross thing.

felipe
06-29-2007, 04:17 PM
Well.. what I mean is that sometimes i have to convert radians to degrees to that weird system of negative and positive. What I usually do is something like Math.atan(yvelocity/xvelocity)/Math.PI * 180, but then i have to turn that into that strange system. I guess my real question was, how can I get a formula or function that converts degrees to that "rotation point" system?

whizkid1990
07-06-2007, 02:33 PM
_rotation=_rotation-1; something like that

orange gold
07-06-2007, 05:16 PM
_rotation=_rotation-1; something like that
object._rotation += +5;