def run(self): # Running loop while self.player.alive: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() #added functionality to shot elif event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE: Shot.append(Shot(self.player)) #added functionality to move move = pygame.K_a - pygame.K_d self.player.move(move)