Implemented cancel building functionality
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user