import pygame,sys,pymunk #imports def create_apple(space): body = pymunk.Body(1,100,body_type = pymunk.Body.DYNAMIC) body.position = (400,0) shape = pymunk.Circle(body,80) space.add(body,shape) return shape def draw_apples(apples): for apple in apples: pos_x = int(apple.body.position.x) pos_y = int(apple.body.position.y) pygame.draw.circle(screen,(0,0,0),(pos_x,pos_y),80) def static_ball(space): body = pymunk.Body(body_type = pymunk.Body.STATIC) body.position(500,500) shape = pymunk.Circle(body,50) space.add(body,shape) return shape #General setup pygame.init() clock = pygame.time.Clock() #Display Surface / variables screen = pygame.display.set_mode((800,800)) space = pymunk.Space() space.gravity = (0,100) apples = [] apples.append(create_apple(space)) #Loop that is always true while True: for event in pygame.event.get(): #Closing the game if event.type == pygame.QUIT: pygame.quit() sys.exit() #Drawing (making code into visable image) screen.fill((255,255,255)) draw_apples(apples) #Misc/framerate pygame.display.update() clock.tick(120)