Windows negative direction values

scorpafied

Member
i have a quick question. trying to understand the direction built in variable a bit better.

the help notes say 90 is up, 0 is right 180 is left and so on. but i was watching a tutorial where a guy multiplied it by negative 1. now i understand that instantly makes it a negative number. what i dont understand is how gamemaker treats that. because the manual doesnt mention negative numbers.
 

Joe Ellis

Member
Negative angles are kind of confusing, but it ends up being counterclockwise instead of clockwise, and vice versa, but the coordinates of x & y are easier to understand cus they're just a position in the room normally.
If you're using direction, you could treat left as clockwise\positive and right as anticlockwise\negative, that makes the angles easier to understand than having to work out how far right 217 degrees is for example
 

scorpafied

Member
Negative angles are kind of confusing, but it ends up being counterclockwise instead of clockwise, and vice versa, but the coordinates of x & y are easier to understand cus they're just a position in the room normally.
If you're using direction, you could treat left as clockwise\positive and right as anticlockwise\negative, that makes the angles easier to understand than having to work out how far right 217 degrees is for example
ahh so it basically just sends it back in the direction it came from from if u multiply it by negative one? is that right

and apologies for the topic title. i have no clue how it got called that. it must of auto filled it? no idea... in anycase i fixed that so its more accurate to the question
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
ahh so it basically just sends it back in the direction it came from from if u multiply it by negative one? is that right
Not quite... 90 * -1 is -90, which would be 270º so in this case yes, BUT for example 45 * -1 is -45 which is actually 315º so it's not the reverse of the original angle. Basically multiplying any angle by -1 converts the angle into 360 - angle.
 
Top