pvjc26/a5.2/game.h
2026-05-08 14:16:31 +02:00

27 lines
848 B
C

#ifndef _GAME_H_INCLUDE_
#define _GAME_H_INCLUDE_
#include "world.h"
#define MOUSE_COUNT 5
// Game state structure
struct game {
int cat_x; // Cat X position
int cat_y; // Cat Y position
int mouse_x[MOUSE_COUNT]; // 5 mouse X positions
int mouse_y[MOUSE_COUNT]; // 5 mouse Y positions
int mouse_alive[MOUSE_COUNT]; // 1 if alive, 0 if eaten
int score; // Score (0-5)
char message[100]; // End-game message
int game_won; // Flag to track if game is won
int win_tick; // Counter to display message for a few frames
};
// Returns pointer to newly allocated game state
void* init_game();
// Handles game events and updates state
int game_event(struct event* event, void* game);
#endif