
Game_window.blit(score_surface, score_rect) Score_rect.midtop = (frame_size_x / 2, frame_size_y / 1.25)

Score_rect.midtop = (frame_size_x - 100, 15) Score_surface = score_font.render('Score : ' + str(score), True, color) Game_window.blit(game_over_surface, game_over_rect)ĭef show_score(choice, color, font, size): Game_over_rect.midtop = (frame_size_x / 2, frame_size_y / 4) Game_over_rect = game_over_surface.get_rect() Game_over_surface = my_font.render('YOU DIED', True, red) Game_window = _mode((frame_size_x, frame_size_y))

Print(f' Had errors when initialising game, exiting.') # second number in tuple gives number of errors

The problem isn't how to make the game restart when you press space but to actually make it restart. In the game that I have found on github there is a game over screen that shows your score, now I want to make the game restart if you press space so that you don't need to close the program and open it again to play it again.
