Adoranda/include/map.h

27 lines
606 B
C
Raw Normal View History

2021-07-29 18:33:22 +02:00
#pragma once
#include <gint/display.h>
#include "engine.h"
2021-07-29 18:33:22 +02:00
struct map {
2021-08-08 01:43:26 +02:00
/*width, height and the number of layer of the map (max 2)*/
int w, h, nb_layer;
2021-08-08 01:43:26 +02:00
/*the tileset to use*/
2021-07-29 18:33:22 +02:00
bopti_image_t *tileset;
2021-08-08 01:43:26 +02:00
/*list of all background tiles (layer 1)*/
short *tiles_layer1;
2021-08-08 01:43:26 +02:00
/*list of all "physical" tiles (layer 2)*/
short *tiles_layer2;
2021-08-08 01:43:26 +02:00
/*state of each tile on the map (solid, air ...)*/
short *info_map;
2021-07-29 18:33:22 +02:00
};
enum map_state {
TILE_AIR = 0,
TILE_SOLID = 1,
2021-08-06 23:42:49 +02:00
TILE_DOOR = 2,
TILE_CHARACTER = 3,
2021-07-29 18:33:22 +02:00
};
int map_walkable(struct map const *map, int x, int y);
int map_get_player_tile(struct game const *game);