struct progress { uint8_t player_lives; uint8_t level_index; uint8_t diamonds_collected; }; struct level { uint16_t size; uint8_t sizeX, sizeY; uint8_t viewX, viewY; uint8_t diamonds_required; char name[10]; uint8_t entities_count; }; struct entity { uint8_t posX, posY; uint8_t direction; }; #define LEVEL_SIZE_MAX 768 #define LEVEL_ENTITIES_MAX 30 extern struct level level; extern struct progress progress; extern struct entity entities[LEVEL_ENTITIES_MAX]; extern uint8_t level_data[LEVEL_SIZE_MAX]; enum level_cell_properties { PROPERTY_FALLING = 0x80, PROPERTY_CRUSHED = 0x20, }; enum level_cell_hides { HIDDEN_MAGIC_WALL = 0x10, HIDDEN_EXIT = 0x40, }; enum level_play_result { QUIT, DIED, DONE, PLAYING }; void level_info(void); enum level_play_result level_play(void);