diff options
Diffstat (limited to 'src/level.c')
-rw-r--r-- | src/level.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/level.c b/src/level.c index 72e60d1..1259922 100644 --- a/src/level.c +++ b/src/level.c @@ -41,8 +41,19 @@ void level_find(int tile, int *x, int *y) if (x != NULL) *x = i % width * TILE_SIZE; if (y != NULL) - *y = i % height * TILE_SIZE; + *y = i / width * TILE_SIZE; return; } } } + +void level_draw(void) +{ + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + const int t = data[x + y * width]; + if (t && t != 2) + LZY_DrawTile(t, x * TILE_SIZE, y * TILE_SIZE); + } + } +} |