indexing description: "[ An EM_SCENE that houses EM_GOOF_PHYSICS, displays and loades it from xml file. ]" date: "$Date$" revision: "$Revision$" class EM_GOOF_LEVEL_SCENE inherit EM_DRAWABLE_SCENE redefine redraw, handle_key_down_event end create make feature {NONE} -- Properties last_process: INTEGER -- Last processing time time_factor: DOUBLE is 0.0008 -- Timing factor feature {NONE} -- Drawing draw_all is -- Draw background, all inactive and the current active item to screen do end redraw is -- Redraw local -- file: PLAIN_TEXT_FILE now: INTEGER do Precursor now := time.ticks physics.process((now-last_process)*time_factor) last_process := now end feature -- Properties physics: EM_GOOF_PHYSICS -- Level physics feature {NONE} -- Properties loader: EM_GOOF_LOADER_LEVEL_FILE -- Level loader feature {NONE} -- Initialization make(level_file: STRING) is -- Initialize `Current'. do make_scene create loader.make_from_file(level_file) physics := loader.goof_level main_container.extend(physics) last_process := time.ticks end feature -- Event Handlers handle_key_down_event (a_keyboard_event: EM_KEYBOARD_EVENT) is -- Handle key down event. do if a_keyboard_event.key = a_keyboard_event.sdlk_escape then event_loop.stop end end end