node implementation on spawn areas

This commit is contained in:
2025-07-22 10:06:56 +02:00
parent 6b39998232
commit 7c12f31ed9
4 changed files with 28 additions and 2 deletions

View File

@@ -34,6 +34,13 @@ pub const SpawnArea = struct {
};
}
pub fn getNodeLocation(self: *const SpawnArea) rl.Vector2 {
return rl.Vector2{
.x = self.location.x + @as(f32, @floatFromInt(self.width)) * globals.getScale() / 2.0,
.y = self.location.y + @as(f32, @floatFromInt(self.height)) * globals.getScale() / 2.0,
};
}
pub fn draw(self: *const SpawnArea) void {
const rect = rl.Rectangle{
.x = self.location.x,
@@ -42,6 +49,5 @@ pub const SpawnArea = struct {
.height = @as(f32, @floatFromInt(self.height)) * globals.getScale(),
};
rl.drawRectangleRec(rect, .dark_gray);
// todo draw cars
}
};