diff options
| author | ilotterytea <iltsu@alright.party> | 2025-01-18 02:37:35 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-01-18 02:37:35 +0500 |
| commit | 2933e4c995da93cd0084b1b4eb2f0ce232b1f406 (patch) | |
| tree | f9ff5dfc7405a28d3bdcc235f442567fe6523fcf | |
| parent | d740ead06e758a637908de709d0114840890f9f3 (diff) | |
feat: drawing points
| -rw-r--r-- | src/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,3 +1,4 @@ +#include <stddef.h> #include <stdlib.h> #include "level.h" @@ -35,6 +36,26 @@ int main() { DrawLine(0, y * gridSize, GetScreenWidth(), y * gridSize, LIGHTGRAY); } + // Drawing points + for (int x = 0; x < level->width; x++) { + for (int y = 0; y < level->height; y++) { + Color color = GRAY; + + for (int i = 0; i < level->height * level->width; i++) { + Side *side = level->sides[i]; + if (side == NULL) continue; + + if ((x == side->a.x && y == side->a.y) || + (x == side->b.x && y == side->b.y)) { + color = RED; + break; + } + } + + DrawCircle(x * gridSize, y * gridSize, 4, color); + } + } + EndDrawing(); } |
