Implemented cancel building functionality

This commit is contained in:
2026-04-25 02:25:45 +02:00
parent 064ef7f63e
commit c14ac533dc
3 changed files with 28 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ Node :: struct {
roads: [dynamic]u32,
}
// Node Initialisation
// Constructor
node_init :: proc(new_pos: rl.Vector2) -> Node {
return {
enabled = true,
@@ -22,6 +22,11 @@ node_init :: proc(new_pos: rl.Vector2) -> Node {
}
}
// Destructor
node_deinit :: proc(self: ^Node) {
delete(self.roads)
}
// Returns whether passed pos(ition) is within this node's snapping radius
node_within_snapping_radius :: proc(self: ^Node, pos: rl.Vector2) -> bool {
return rl.CheckCollisionPointCircle(