I want to create a trail of every ball i create, but i cant think of anything that would help me to do it
def create_balls(space,x,y):
body = pymunk.Body()
body.position = (x,y)
shape = pymunk.Circle(body, 10)
shape.density = 1
shape.elasticity = 1
space.add(body, shape)
return shape
def draw_balls(balls):
for ball in balls:
pos_x = int(ball.body.position.x)
pos_y = int(ball.body.position.y)
pygame.draw.circle(display,(red,green,blue),(pos_x,pos_y),10)