def read_ball_data(): new_ball = Ball() new_ball.color = input('Informe a cor da bola: ') new_ball.circumference = float(input('Informe a circunferĂȘncia da bola: ')) new_ball.brand = input('Informe a marca da bola: ') return new_ball
# - Collision of ball # - Locking angle and power # - Checking if power up buttons are clicked # - Shooting the ball, uses physics module # - Keeping track of strokes # - Calls all functions and uses modules/classes imported and defined above # Start loop # Display start screen run_start_screen(win) # Game Loop for levels and collision while True: if not stickyPower and not superPower: ballColor = startScreen.getBallColor() ball.color = (255,255,255) if ballColor is None else ballColor for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: pygame.quit() if event.key == pygame.K_SPACE: display_end_level() if event.type == pygame.MOUSEMOTION: pos = pygame.mouse.get_pos() for power_up_button in powerUpButtons: if power_up_button.is_on_me(pos): power_up_button.color = power_up_button.color_when_hovered() else: power_up_button.color = power_up_button.default_color()