# Hill (static line segments) hill_points = [(50, 500), (150, 450), (250, 380), (350, 340), (450, 330), (550, 350), (650, 400), (750, 480)]
# Step physics space.step(1/60.0)
# Create cars cars = [Car(80, 480), Car(120, 460), Car(160, 435)] drive cars down a hill script
for i in range(len(hill_points)-1): segment = pymunk.Segment(space.static_body, hill_points[i], hill_points[i+1], 2) segment.friction = 0.8 segment.elasticity = 0.5 space.add(segment) # Hill (static line segments) hill_points = [(50,
# Main loop running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE: cars.append(Car(80, 480)) 5) ground.friction = 0.9 space.add(ground)
# Ground at bottom ground = pymunk.Segment(space.static_body, (0, HEIGHT-50), (WIDTH, HEIGHT-50), 5) ground.friction = 0.9 space.add(ground)