From a329062531af634acc8b7a78c6f20914ee7bc404 Mon Sep 17 00:00:00 2001 From: Anzhelika Nikolaieva Date: Sun, 28 May 2023 16:05:31 +0000 Subject: [PATCH] Add 'final/game.h' --- final/game.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 final/game.h diff --git a/final/game.h b/final/game.h new file mode 100644 index 0000000..2e4ce6e --- /dev/null +++ b/final/game.h @@ -0,0 +1,35 @@ +#ifndef _GAME_H_INCLUDE_ +#define _GAME_H_INCLUDE_ + +#define CACTUS_COUNT 5 +#include "world.h" + +// Set of variables that expresses state of the game. + +struct game { +//xposition of the dino +int dinox; +//y position of the dino +int dinoy; +//jumps counters +int jumps; +//изменяет цвета динозавра +int color; + +int type[CACTUS_COUNT]; +int first_cactusx[CACTUS_COUNT]; +int cactusx[CACTUS_COUNT]; +//x and y positions of +int cactusy[CACTUS_COUNT]; +int score; +int level; +char message[100]; +}; + +// Returns pointer to newly allocated state +void* init_game(); + +// Changes world according to the game state (pressed key, screen size or other event) +int game_event(struct event* event,void* game); + +#endif