How to move a sprite according to an angle in Pygame
you just need a little basic trig def calculat_new_xy(old_xy,speed,angle_in_radians): new_x = old_xy.X + (speed*math.cos(angle_in_radians)) new_y = old_xy.Y + (speed*math.sin(angle_in_radians)) return new_x, new_y — edit — Here is your code from above edited to work import pygame, math, time screen=pygame.display.set_mode((320,240)) clock=pygame.time.Clock() pygame.init() def calculate_new_xy(old_xy,speed,angle_in_radians): new_x = old_xy[0] + (speed*math.cos(angle_in_radians)) new_y = old_xy[1] + (speed*math.sin(angle_in_radians)) return new_x, … Read more