def create_pause_menu(self, pause_menu_batch): paused_game_label = \ utils.create_title_label('Paused', pause_menu_batch) menu_label_texts = ['Resume game', 'Main menu', 'Exit'] return utils.create_menu_labels(menu_label_texts, pause_menu_batch)
def create_main_menu(self, main_menu_batch): asteroids_game_label = utils.create_title_label( 'Asteroids', main_menu_batch) menu_asteroids = load.asteroids( 25, random_sizes=True, batch=main_menu_batch) menu_label_texts = ['New game', 'Top scores', 'Exit'] return ( utils.create_menu_labels(menu_label_texts, main_menu_batch), menu_asteroids, )
def create_top_score_menu( self, top_score_batch, top_scores, create_title=True): if create_title: top_score_label = \ utils.create_title_label('Top scores', top_score_batch) top_score_texts = [] for ts in top_scores[:5]: score_text = '{} {} {}'.format( ts['name'], ts['level'], ts['score']) top_score_texts.append(score_text) top_score_texts.append('Main menu') return utils.create_menu_labels(top_score_texts, top_score_batch)
def create_game_over_labels(self, game_over_batch): game_over_label = utils.create_title_label( 'Game over', game_over_batch) l0 = utils.create_menu_label( self.score_label.text, game_over_batch, selected=True ) l1 = utils.create_menu_label( '{} {} {}'.format( self.player_name[0], self.player_name[1], self.player_name[2], ), game_over_batch, selected=True, y=320, ) return l0, l1