Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///obj_menu///
- //CREATE:
- menu[ 0 , 0 ] = 'Play';
- menu[ 0 , 1 ] = 'room_goto_next()';
- menu[ 1 , 0 ] = 'Quit';
- menu[ 1 , 1 ] = 'game_end()';
- menu_max = 2;
- menu_sel = 0;
- //STEP:
- if keyboard_check_pressed(vk_up)
- {
- menu_sel = menu_sel - 1;
- }
- if keyboard_check_pressed(vk_down)
- {
- menu_sel = menu_sel + 1;
- }
- if menu_sel >= menu_max
- {
- menu_sel = menu_sel - menu_max;
- }
- if menu_sel < 0
- {
- menu_sel = menu_max + menu_sel;
- }
- if keyboard_check_pressed( vk_enter )
- {
- execute_string( menu[ menu_sel , 1 ] );
- }
- //DRAW:
- var i;
- for(i=0;i<menu_max;i=i+1)
- {
- draw_set_color( c_black );
- if ( i == menu_sel )
- {
- draw_set_color( c_yellow );
- }
- draw_text( 0 , i * 20 , menu[ i , 0 ] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement