• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

clockwise/counter clockwise, how can i check this?

D

Dave Martinez

Guest
Is there a way to check if an object's image angle is moving clockwise or counter clockwise, in order to make it continue moving that angle?

The angles are confusing me.

if (clockwise=1)
{
image_angle -= 1
}

if (clockwise=0)
{
image_angle += 1
}
 
D

Dave Martinez

Guest
How would I go by doing that? An examples? Ive been trying different methods with no success.

Code:
if image_angle > 0 and image_angle < 90
{
clockwise = 1
}
if image_angle > 90 and image_angle < 180
{
clockwise = 0
}
if image_angle > 180 and image_angle < 270
{
clockwise = 1
}
if image_angle > 270 and image_angle < 359
{
clockwise =0
}
 
A

anomalous

Guest
Create an image_angle_previous, at the end of step or draw (or later) set it to image angle

Then something like this (you can fiddle, you get the idea)

if sign(angle_difference(image_angle_previous,image_angle)) >0 clockwise = 0;
else clockwise = 1;
 
N

Never Mind

Guest
Like their saying you can define your own new variable, then set it to whatever value you want.
Code:
MyNewVariable= image_angle; // make a new variable and set it to the value of image_angle
 
D

Dave Martinez

Guest
Ok still cant get it to work... thank you for the responses, I will continue to work on it later, ill deal without it for now.
 
Last edited by a moderator:
Top