pvjc26/final/game.h
2026-05-10 10:44:22 +02:00

91 lines
1.6 KiB
C

#ifndef _GAME_H_
#define _GAME_H_
#include "world.h"
#define MAX_RIADKOV 7
#define MAX_STLPCOV 10
#define ZIVOTY 3
#define RYCHLOST_HRY 120
#define PALKA_SIRKA_MIN 7
#define PALKA_SIRKA_MAX 14
#define PALKA_ROW_OD_DNA 2
#define MAX_LOPT 16
#define BOSS_CAS 240
typedef enum {
STAV_UVOD,
STAV_CAKA,
STAV_HRAJE,
STAV_KONIEC,
STAV_VYHRAL,
STAV_DALSI_LEVEL,
} StavHry;
typedef struct {
int x, y;
int sirka;
} Palka;
typedef struct {
float x, y;
float dx, dy;
int ziva;
} Lopta;
typedef struct {
int ziva;
int farba;
char znak;
} Tehla;
typedef struct {
int ziva;
float x, y;
char znak;
short farba;
} PowerUp;
typedef struct {
int ziva;
float x, y;
float dx;
int pada;
} Boss;
typedef struct {
Palka palka;
Lopta lopty[MAX_LOPT];
int pocet_lopt;
Tehla tehly[MAX_RIADKOV][MAX_STLPCOV];
int zivoty;
int skore;
int zostatok_tehiel;
int level;
int riadkov;
float rychlost;
StavHry stav;
int sirka;
int vyska;
char meno[32];
int meno_dlzka;
PowerUp powerupy[2];
int hit_counter;
int sirka_timer;
int posledna_lopta;
int cas_tikov;
int special_dostupny;
Boss boss;
} Hra;
void* init_game();
int game_event(struct event* udalost, void* hra);
void destroy_game(void* hra);
void pohni_palku(Hra* h, int smer);
void pohni_lopty(Hra* h);
void inicializuj_tehly(Hra* h);
void vykresli_hru(Hra* h);
#endif