indexing description: "[ START describes the start menu. ]" date: "$Date$" revision: "$Revision$" class START inherit MENU redefine initialize_scene, redraw end create make_scene feature -- Commands initialize_scene is -- Initialize the scene local i, y: INTEGER do Precursor -- build the menu entries create menu_entries.make (1, 4) menu_entries.put (create {EM_STRING}.make ("Start", normal_font), 1) menu_entries.put (create {EM_STRING}.make ("Instructions", normal_font), 2) menu_entries.put (create {EM_STRING}.make ("Credits", normal_font), 3) menu_entries.put (create {EM_STRING}.make ("Quit", normal_font), 4) y := 350 from i := 1 until i > menu_entries.count loop menu_entries.item (i).set_x_y (512 - menu_entries.item (i).width // 2, y) y := menu_entries.item (i).height + y i := i + 1 end selected_nr := 1 menu_entries.item (selected_nr).set_font (select_font) end feature {NONE} -- Event handler on_select is -- Set the `next_scene' according to `selected_nr' here do if selected_nr = 1 then -- start next_scene := create {SIMPLE}.make_scene elseif selected_nr = 2 then -- Instructions next_scene := create {INSTRUCTIONS}.make_scene elseif selected_nr = 3 then -- credits next_scene := create {CREDITS}.make_scene elseif selected_nr = 4 then -- quit next_scene := void end end redraw is -- Redraw the scene do screen.clear scene.draw (screen) draw_menu_entries screen.redraw end end