Game.h 931 B

12345678910
  1. #pragma once
  2. void init_game(char** , int&, int&, int*, int*, DIRECTION&, int&, int&, int&, int&);//Óñòàíàâëèâàþòñÿ íà÷àëüíûå çíà÷åíèÿ ïàðàìåòðîâ èãðû.
  3. void set_snake(char**, int*, int*, int&);//Çìåéêà óñòàíàâëèâàåòñÿ â èãðîâîì ïîëå
  4. void clear_snake(char**, int*, int*, int&);//Î÷èùàåòñÿ ïîçèöèÿ çìåéêè â ìàññèâå
  5. void set_food(char**, int&, int&, int&, bool&, int&, int&); // Åäà óñòàíàâëèâàåòñÿ â èãðîâîì ïîëå.
  6. void check_eating(int* snake_x, int* snake_y, int& food_y, int& food_x, int& snake_size, bool& food_flag, int& score);//Âûïîëíÿåòñÿ ïðîâåðêà òîãî, ÷òî çìåéêà ñúåëà åäó.
  7. void check_snake(char**, int*, int*, int&);//Âûïîëíÿåòñÿ ïðîâåðêà òîãî, ÷òî çìåéêà âñòðåòèëàñü ñ õâîñòîì.
  8. int check_game(char**, int*, int*, int&, bool&, int&);//Ïðîâåðêà çàâåðøåíèÿ èãðû.
  9. void handle_cmd(DIRECTION&, int&);//Îáðàáîòêà ïîëüçîâàòåëüñêîãî ââîäà
  10. void game_over(char**, int&, int&, int*, int*, int&); // âûâîä èíôîðìàöèè ïðè îêîí÷àíèå èãðû