Entropie git · main
git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gzmap.h raw
#ifndef MAP_H
#define MAP_H
#include <stdio.h>
#include "character.h"
extern int MAP_WIDTH;
extern int MAP_HEIGHT;
extern const int TILE_SIZE;
typedef enum {
TILE_EMPTY,
TILE_WALL,
TILE_HOUSE,
TILE_WATER,
TILE_WAY,
TILE_ROAD,
TILE_TRACK,
TILE_GRAVEL,
TILE_TREE,
TILE_GRASS,
TILE_DIRT,
TILE_PLAYER_SPAWN,
TILE_CHARACTER_SPAWN,
TILE_COLLECTABLE
} TileType;
typedef enum {
CHARACTER_0,
CHARACTER_1,
CHARACTER_2,
CHARACTER_3,
CHARACTER_MAX,
COLLECTABLE_0,
COLLECTABLE_1,
COLLECTABLE_2,
COLLECTABLE_3,
COLLECTABLE_MAX,
} MapObjectType;
typedef struct {
TileType type;
Object* object;
} Tile;
extern TileType** map;
extern MapObjectType*** map_objects;
extern unsigned char** map_objects_count;
Tile* Tile_create();
void Map_log(void);
int Map_load(const char* filename, Character* characters, int characters_size, Object*);
int Map_isPassable(float x, float y, float w, float h);
void Map_free();
#endif