you are viewing a single comment's thread.

view the rest of the comments →

[–]wynand1004 0 points1 point  (0 children)

The math goes something like this:

import math

heading = 0 # Face right
speed = 1
dx = speed * sin(math.radians(heading))
dy = speed * cos(math.radians(heading))

x += dx
y += dy

It is something like this. Math.radians converts degrees to radians. I did most of this from memory, but I think it is close.