def title_screen(): mp.queue(Resources.audio['title_bgm']) my_logo = OrderedGroup(0) my_button = OrderedGroup(1) # Instantiation section # logo = MyRectangle(name = "logo", curr_state = 'TITLE', img = Resources.sprites['logo'], x = Resources.window_width*0.5, y = Resources.window_height*0.5, batch = title_batch, group = my_logo) logo.opacity = 255 play_button = Button(name = 'start_button', curr_state = 'TITLE', target_state = 'SETUP', world = manager, img = Resources.sprites['play_button'], x = Resources.window_width*0.5+50, y = Resources.window_height*0.5-110, batch = title_batch, group = my_button) # End of Instantiation # # Handler specification # game_window.push_handlers(play_button) # End of specification # # Importation section # manager.add_widget(play_button) manager.add_widget(logo)
def end_screen(): game_over = MyRectangle(name = "game_over", curr_state = 'END', img = Resources.sprites['game_over'], x = 150, y = 225, batch = end_batch) game_over.opacity = 255 quit_button = QuitButton(name = "quit_button", curr_state = 'END', img = Resources.sprites['quit_button'], world = manager, x = 400, y = 150, batch = end_batch) # Handler specification # game_window.push_handlers(quit_button) # End of specification # # Importation section # manager.add_widget(quit_button) manager.add_widget(game_over) # End of importation # mp.queue(Resources.audio['end_bgm'])
def end_screen(): game_over = MyRectangle( name="game_over", curr_state="END", img=Resources.sprites["game_over"], x=150, y=225, batch=end_batch ) game_over.opacity = 255 quit_button = QuitButton( name="quit_button", curr_state="END", img=Resources.sprites["quit_button"], world=manager, x=400, y=150, batch=end_batch, ) # Handler specification # game_window.push_handlers(quit_button) # End of specification # # Importation section # manager.add_widget(quit_button) manager.add_widget(game_over) # End of importation # mp.queue(Resources.audio["end_bgm"])
def title_screen(): mp.queue(Resources.audio["title_bgm"]) my_logo = OrderedGroup(0) my_button = OrderedGroup(1) # Instantiation section # logo = MyRectangle( name="logo", curr_state="TITLE", img=Resources.sprites["logo"], x=Resources.window_width * 0.5, y=Resources.window_height * 0.5, batch=title_batch, group=my_logo, ) logo.opacity = 255 play_button = Button( name="start_button", curr_state="TITLE", target_state="SETUP", world=manager, img=Resources.sprites["play_button"], x=Resources.window_width * 0.5 + 50, y=Resources.window_height * 0.5 - 110, batch=title_batch, group=my_button, ) # End of Instantiation # # Handler specification # game_window.push_handlers(play_button) # End of specification # # Importation section # manager.add_widget(play_button) manager.add_widget(logo)
def game_screen(): my_rectangle = OrderedGroup(0) elements = OrderedGroup(1) info_bar = MyRectangle(name = 'info_bar', curr_state = 'GAME', img = Resources.sprites['info_bar'], x = 20, y = Resources.window_height-80, batch = game_batch, group = my_rectangle) thumbnail = MyRectangle(name = 'thumbnail', curr_state = 'GAME', img = Resources.sprites['thumb_green'], x = 5, y = Resources.window_height-55, batch = game_batch, group = elements) thumbnail.opacity = 255 player_name = UILabel(name = 'player_name', text = 'My Player', x = info_bar.x + 38, y = info_bar.y+info_bar.height-27, anchor_y = 'bottom', font_size = 17.0, batch = game_batch, group = elements) label_bounce = UILabel(name = 'label_bounce', text = 'Bounce', x = player_name.x, y = player_name.y-20, anchor_y = 'bottom', font_size = 12.0, batch = game_batch, group = elements) label_power = UILabel(name = 'label_power', text = 'Power', x = label_bounce.x, y = label_bounce.y-20, anchor_y = 'bottom', font_size = 12.0, batch = game_batch, group = elements) player_name.color = (255, 255, 255, 255) label_bounce.color = (255, 255, 255, 255) label_power.color = (255, 255, 255, 255) # Importation section # manager.add_widget(info_bar) manager.add_label(player_name) manager.add_label(label_bounce) manager.add_label(label_power) manager.add_widget(thumbnail) # End of importation # mp.queue(Resources.audio['game_bgm']) my_player = Player(actual_name = "player",name = "player",typex = "green",img = Resources.sprites['marker']) manager.set_client(my_player) for i in range(my_player.bounce): bouncex = MyRectangle(name = 'bounce_'+str(i), curr_state = 'GAME', img = Resources.sprites['bounces'], x = label_bounce.x+60+(i*(Resources.sprites['bounces'].width+3)), y = label_bounce.y+3) bouncex.opacity = 255 bounce_sprites.append(bouncex) for i in range(my_player.power): powerx = MyRectangle(name = 'power_'+str(i), curr_state = 'GAME', img = Resources.sprites['powers'], x = label_power.x+60+(i*(Resources.sprites['powers'].width+3)), y = label_power.y+3) bouncex.opacity = 255 power_sprites.append(powerx)
def game_screen(): my_rectangle = OrderedGroup(0) elements = OrderedGroup(1) info_bar = MyRectangle( name="info_bar", curr_state="GAME", img=Resources.sprites["info_bar"], x=20, y=Resources.window_height - 80, batch=game_batch, group=my_rectangle, ) thumbnail = MyRectangle( name="thumbnail", curr_state="GAME", img=Resources.sprites["thumb_green"], x=5, y=Resources.window_height - 55, batch=game_batch, group=elements, ) thumbnail.opacity = 255 player_name = UILabel( name="player_name", text="My Player", x=info_bar.x + 38, y=info_bar.y + info_bar.height - 27, anchor_y="bottom", font_size=17.0, batch=game_batch, group=elements, ) label_bounce = UILabel( name="label_bounce", text="Bounce", x=player_name.x, y=player_name.y - 20, anchor_y="bottom", font_size=12.0, batch=game_batch, group=elements, ) label_power = UILabel( name="label_power", text="Power", x=label_bounce.x, y=label_bounce.y - 20, anchor_y="bottom", font_size=12.0, batch=game_batch, group=elements, ) player_name.color = (255, 255, 255, 255) label_bounce.color = (255, 255, 255, 255) label_power.color = (255, 255, 255, 255) # Importation section # manager.add_widget(info_bar) manager.add_label(player_name) manager.add_label(label_bounce) manager.add_label(label_power) manager.add_widget(thumbnail) # End of importation # mp.queue(Resources.audio["game_bgm"]) my_player = Player(actual_name="player", name="player", typex="green", img=Resources.sprites["marker"]) manager.set_client(my_player) for i in range(my_player.bounce): bouncex = MyRectangle( name="bounce_" + str(i), curr_state="GAME", img=Resources.sprites["bounces"], x=label_bounce.x + 60 + (i * (Resources.sprites["bounces"].width + 3)), y=label_bounce.y + 3, ) bouncex.opacity = 255 bounce_sprites.append(bouncex) for i in range(my_player.power): powerx = MyRectangle( name="power_" + str(i), curr_state="GAME", img=Resources.sprites["powers"], x=label_power.x + 60 + (i * (Resources.sprites["powers"].width + 3)), y=label_power.y + 3, ) bouncex.opacity = 255 power_sprites.append(powerx)