void stg1(){ while(1){ BACK_TO_FLAG = 0; clear_screen(); setcursor(8,5,1); printg("SNAKE: ADIN EDITION MENU\n\r\0",0,_C_YELLOW); set_border(); draw_game_line(23,25,133,25,_C_YELLOW,1); setcursor(8,8,1); printg("1.- Start Game",0,_C_YELLOW); setcursor(8,9,1); printg("2.- Select Difficult",0,_C_YELLOW); setcursor(8,10,1); printg("3.- Back to screen",0,_C_YELLOW); write_diff(); write_highscore(); select_menu(); if(BACK_TO_FLAG == 1) break; } }
void game_over_init() { int high_dummy; read_highscore(); if(current_score && (high_dummy = addto_highscore((char *)getenv("USER"),current_score,current_level,current_lines))) { write_highscore(); show_highscore(high_dummy); } game_over = TRUE; game_play = FALSE; gdk_draw_rectangle(game_area->window, game_area->style->black_gc, TRUE, 0,0, game_area->allocation.width, game_area->allocation.height); gdk_draw_rectangle(next_block_area->window, next_block_area->style->black_gc, TRUE, 0,0, next_block_area->allocation.width, next_block_area->allocation.height); game_set_pause(GTK_WIDGET(menu_game_pause),NULL); gtk_label_set(GTK_LABEL(Start_stop_button_label),start_stop_str[0]); gtk_widget_set_sensitive(menu_game_quick,TRUE); gtk_widget_set_sensitive(menu_game_start,TRUE); gtk_widget_set_sensitive(menu_game_stop,FALSE); gtk_widget_set_sensitive(Start_stop_button,TRUE); gtk_widget_grab_default(Start_stop_button); gtk_label_set(GTK_LABEL(Pause_button_label),pause_str[0]); gtk_widget_set_sensitive(Pause_button,FALSE); gtk_timeout_remove(timer); }