Add path debug drawing, resources fields

This commit is contained in:
2023-11-14 16:21:14 +01:00
parent 8825b9e01f
commit 274612b035
6 changed files with 82 additions and 14 deletions

View File

@@ -93,3 +93,20 @@ void startPath(ecs_iter_t *it) {
path[i].curWaypoint++;
}
}
void drawDebugPath(ecs_iter_t *it) {
Path *path = ecs_field(it, Path, 1);
for (i32 i = 0; i < it->count; i++) {
for (i32 iPath = 0; iPath < path[i].numWaypoints; iPath++) {
Color color = RED;
if (iPath < path[i].curWaypoint - 1)
color = GREEN;
else if (iPath == path[i].curWaypoint - 1)
color = ORANGE;
color.a = 180;
Position pos = path[i].waypoints[iPath];
DrawCircle(pos.x, pos.y, 3, color);
}
}
}