-
Notifications
You must be signed in to change notification settings - Fork 1
/
tiles.h
55 lines (43 loc) · 959 Bytes
/
tiles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef TILES_H
#define TILES_H
#include "alchemist/elements.h"
enum game_tiles
{
TILE_AIR,
TILE_STONE,
TILE_DIRT,
TILE_SAND,
TILE_SANDSTONE,
TILE_SWEET_TREE,
TILE_SWEET_BUSH,
TILE_SWEET_FLOWER,
TILE_GRASS,
TILE_SWEET_GRASS,
TILE_WATER,
TILE_MAX_NUM
};
enum biomes
{
BIOME_DESERT, // yellow
BIOME_FOREST, // green with trees
BIOME_PLAINS, // green
};
#define BIOMES 3
#define CHUNK_SIZE 16
#define WORLD_SIZE 256
#define WORLD_CENTER WORLD_SIZE/2
#define WORLD_SCALE 100.0
struct tile {
enum game_tiles tile;
};
typedef struct tile chunk_table[CHUNK_SIZE][CHUNK_SIZE];
typedef struct {
enum biomes biome;
chunk_table table;
InventoryElement * items[CHUNK_SIZE*CHUNK_SIZE];
Being * beings[CHUNK_SIZE*CHUNK_SIZE];
Plant * plants[CHUNK_SIZE*CHUNK_SIZE];
Animal * animals[CHUNK_SIZE*CHUNK_SIZE];
Object * objects[CHUNK_SIZE*CHUNK_SIZE];
} chunk;
#endif