From f0c46e37d41ec3ed0d55623950a36bc4621683e7 Mon Sep 17 00:00:00 2001 From: Mykola Syniavskyi Date: Sat, 3 May 2025 10:32:10 +0000 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20a4/game.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a4/game.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 a4/game.h diff --git a/a4/game.h b/a4/game.h new file mode 100644 index 0000000..9b6c2a6 --- /dev/null +++ b/a4/game.h @@ -0,0 +1,31 @@ +#ifndef _GAME_H_INCLUDE_ +#define _GAME_H_INCLUDE_ +#include "world.h" +#define MOUSE_COUNT 5 +// Set of variables that expresses state of the game. +// +struct game { + // X speed of the cat + int catx; + // Y speed of the cat + int caty; + // X position of the cat + int catx_position; + // Y opsition of the cat + int caty_position;; + // X position of the mouse + int mousex[MOUSE_COUNT]; + // Y position of the mouse + int mousey[MOUSE_COUNT]; + int mouse_state[MOUSE_COUNT]; + // Funky message + 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