diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/level.c | 7 | ||||
| -rw-r--r-- | src/main.c | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/level.c b/src/level.c index fbe6260..c805c04 100644 --- a/src/level.c +++ b/src/level.c @@ -29,13 +29,6 @@ Level *SE_CreateLevel(int width, int height) { void SE_RenderLevel(Level *level) { int cell_size = 10; - for (int x = 0; x < level->width; x++) { - for (int y = 0; y < level->height; y++) { - DrawRectangleLines(cell_size * x, cell_size * y, cell_size, cell_size, - LIGHTGRAY); - } - } - for (int i = 0; i < level->width * level->height; i++) { Vector3 *vector = level->vectors[i]; DrawRectangle(vector->x, vector->y, 2, 2, BLACK); @@ -6,6 +6,8 @@ int main() { InitWindow(800, 600, "sillyeditor"); SetTargetFPS(60); + int gridSize = 32; + Level *level = SE_CreateLevel(30, 30); while (!WindowShouldClose()) { @@ -16,6 +18,15 @@ int main() { SE_RenderLevel(level); + // Drawing grid + for (int x = 0; x <= level->width; x++) { + DrawLine(x * gridSize, 0, x * gridSize, GetScreenHeight(), LIGHTGRAY); + } + + for (int y = 0; y <= level->height; y++) { + DrawLine(0, y * gridSize, GetScreenWidth(), y * gridSize, LIGHTGRAY); + } + EndDrawing(); } |
