indexing description: "[ Game over screen ]" date: "$Date$" revision: "$Revision$" class BB_GAME_OVER inherit BB_MENU EM_SHARED_SUBSYSTEMS export {NONE} all end create make feature -- Initialization make (a_score: INTEGER; a_level_set: STRING) is -- create game over screen require a_level_set /= Void local menu_button: BB_MENU_BUTTON do init_menu score := a_score level_set := a_level_set.out video_subsystem.show_cursor play_music ("./bgm/menu.ogg") -- create game over label create gameover_label.make_from_text ("Game Over") gameover_label.set_font(create {EM_TTF_FONT}.make_from_ttf_file ("./fonts/moo.ttf", 90)) gameover_label.set_foreground_color (create {EM_COLOR}.make_white) gameover_label.resize_to_optimal_dimension gameover_label.set_position (Window_width // 2 - gameover_label.width // 2, 200) add_widget(gameover_label) create menu_button.make ("Ok") menu_button.set_position (Window_width // 2 - menu_button.width // 2, 450) menu_button.pressed_event.subscribe (agent back_button_pressed) add_button (menu_button) set_selected_menu_item (1) end feature -- Events back_button_pressed is -- Handle keyboard events do if level_set.is_equal ("original") then set_next_scene (create {BB_LOCAL_HIGHSCORE}.make_with_new_entry (score)) else set_next_scene (create {BB_SINGLEPLAYER}.make) end start_next_scene end feature {NONE} -- Implementation gameover_label: EM_LABEL -- game over string score: INTEGER -- score which was reached level_set: STRING -- level set which was used end