• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

### #Actualmrjones

Posted 16 May 2012 - 04:36 AM

I think you might want this equation, if sp is just distance, not a vector. Moving at angle 0 means moving on x-axis in this equation:

x2 = x1 + cos(angle) * sp
y2 = y1 + sin(angle) * sp


For example moving from (0, 0) at an angle 0 to distance 5 would give the following result:
x2 = 0 + 1 * 5 = 5
y2 = 0 + 0 * 5 = 0


### #1mrjones

Posted 16 May 2012 - 04:36 AM

I think you might want this equation instead, if sp is just distance, not a vector. Moving at angle 0 means moving on x-axis in this equation:

x2 = x1 + cos(angle) * sp
y2 = y1 + sin(angle) * sp


For example moving from (0, 0) at an angle 0 to distance 5 would give the following result:
x2 = 0 + 1 * 5 = 5
y2 = 0 + 0 * 5 = 0


PARTNERS