while True: # Cycles through all the events currently occuring for event in pygame.event.get(): # Condition becomes true when keyboard is pressed if event.type == pygame.KEYDOWN: if event.key == pygame.K_m: fireball.fire() music_manager.playsound(fsound, 0.3) if event.key == pygame.K_n: handler.next_stage() pygame.quit() sys.exit()