From 2a0aed698ee7422e6e34e4ca9997525a98e02cfa Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Sat, 17 Apr 2021 19:00:34 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'a4/game.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a4/game.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/a4/game.c b/a4/game.c index 22c43b3..bf1a495 100644 --- a/a4/game.c +++ b/a4/game.c @@ -10,14 +10,14 @@ void* init_game(){ struct game* st = calloc(1,(sizeof(struct game))); // Initialize state for(int i = 0; i < MOUSE_COUNT; i++){ - st->mousex[i] = rand()%15; - st->mousey[i] = rand()%15; - st->mouse_state[i] = 0; - } - st->catx = 0; - st->caty = 0; - st->catx_position = 15; - st->caty_position = 15; + st->mousex[i] = rand()%15; // Рандомная позиция мышей на карте + st->mousey[i] = rand()%15; // --//-- + st->mouse_state[i] = 0; // состояние мышы -- жива + } //генерация мышей + st->catx = 0; //скорость кота + st->caty = 0; // --//-- + st->catx_position = 15; // Позиция кота на карте + st->caty_position = 15; // --//-- // Store pointer to the state to the world variable return st; } @@ -26,7 +26,7 @@ void* init_game(){ // It should modify the state and draw it. int game_event(struct event* event,void* game){ // Get state pointer - struct game* state = game; + struct game* state = game; // Зоздание игры char msg[200]; sprintf(msg,"%d",event->type); set_message(msg,10,0);