indexing description: "[ Root class of the example. ]" date: "$Date$" revision: "$Revision$" class STARTER inherit EM_APPLICATION redefine initialize_video_subsystem end create make feature -- Initialization make is -- Make the tester -- Entry point for the application do initialize_video_subsystem initialize_screen from level_file := "nope" until level_file = void loop level_file := void create_menu set_scene(menu) launch if level_file /= void then create my_scene.make(level_file) set_scene(my_scene) launch end end end create_menu is -- Make and load menu local button: EM_BUTTON do create menu.make_component_scene create button.make_from_text("Jumping Ball") button.set_x(30) button.set_y(30) button.set_width(200) button.set_height(50) button.clicked_event.subscribe(agent button_jumping_balls_click) menu.add_component(button) create button.make_from_text("Solar System") button.set_x(30) button.set_y(100) button.set_width(200) button.set_height(50) button.clicked_event.subscribe(agent button_solar_system_click) menu.add_component(button) create button.make_from_text("Quit") button.set_x(30) button.set_y(170) button.set_width(200) button.set_height(50) button.clicked_event.subscribe(agent button_quit_click) menu.add_component(button) end initialize_video_subsystem is -- initializes subsystem do video_subsystem.set_video_surface_width (width) video_subsystem.set_video_surface_height (height) video_subsystem.set_video_bpp (resolution) video_subsystem.set_cursor_visibility (False) if fullscreen then video_subsystem.set_hardware_surface (false) video_subsystem.set_software_surface (true) video_subsystem.set_fullscreen (true) end end feature -- Implementation my_scene: EM_GOOF_LEVEL_SCENE -- Main game scene menu: EM_COMPONENT_SCENE -- Main menue width: INTEGER is 1024 -- Width of surface height: INTEGER is 768 -- Height of surface resolution: INTEGER is 32 -- Resolution of surface fullscreen: BOOLEAN is false -- Fullscreen mode? level_file: STRING -- Witch level to load? feature -- Handler button_jumping_balls_click is -- Button clicked! local execution_environment: EXECUTION_ENVIRONMENT do create execution_environment level_file := execution_environment.current_working_directory + "/levels/jumping_balls.xml" menu.event_loop.stop end button_solar_system_click is -- Button clicked! local execution_environment: EXECUTION_ENVIRONMENT do create execution_environment level_file := execution_environment.current_working_directory + "/levels/solar_system.xml" menu.event_loop.stop end button_quit_click is -- Button clicked! do menu.event_loop.stop end end