game.h (1034B)
1 #pragma once 2 3 typedef struct Assets assets_t; 4 typedef struct Game game_t; 5 6 #include "entity.h" 7 #include "player.h" 8 #include "tile.h" 9 #include "menu.h" 10 #include "level.h" 11 #include "effect.h" 12 #include "door.h" 13 14 #define GAME_SCEEN_TIMER 150 15 #define GAME_MUSIC_VOLUME 0.7f 16 #define GAME_SOUND_VOLUME 1.0f 17 18 typedef enum { 19 STATE_MENU, 20 STATE_GAME, 21 } state_e; 22 23 struct Assets { 24 Texture2D tiles; 25 Texture2D entities; 26 Texture2D font; 27 Texture2D images; 28 Texture2D background; 29 Sound track; 30 Sound win; 31 Sound lose; 32 Sound locked; 33 }; 34 35 struct Game { 36 state_e state; 37 level_t *level; 38 bool quit; 39 bool defeat; 40 bool victory; 41 menu_t *menu; 42 player_t *player; 43 tile_t **tiles; 44 int tiles_len; 45 entity_t *entities; 46 int entities_len; 47 effect_t **effects; 48 int effects_len; 49 assets_t assets; 50 Camera2D camera; 51 int xp; 52 int sceen_timer; 53 door_t *door; 54 RenderTexture2D overlay; 55 bool is_muted; 56 }; 57 58 game_t *game_create(void); 59 void game_update(game_t *game); 60 void game_draw(game_t *game); 61 void game_free(game_t *game);