Add path debug drawing, resources fields
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user