diff --git a/common/constants.odin b/common/constants.odin index 090a39a..ced4753 100644 --- a/common/constants.odin +++ b/common/constants.odin @@ -2,19 +2,32 @@ package common import rl "vendor:raylib" +// Screen Width WIDTH :: 1920 +// Screen Height HEIGHT :: 1080 +// Default Monitor MONITOR :: 0 +// Thickness of the road being drawn ROAD_SIZE :: 20 +// Radius of the node NODE_RADIUS :: 20 +// Size of designated radius that determines when position is within node's 'sphere' NODE_SNAP_RADIUS :: 3 +// Default text size TEXT_SIZE :: 50 +// Default road colour ROAD_COLOUR :: rl.BLACK +// Node colour once it's fully built NODE_DONE_COLOUR :: rl.BROWN +// Node colour while node is being built NODE_BUILD_COLOUR :: rl.GOLD +// Node colour while being able to start building but not doing that yet NODE_CURSOR_COLOUR :: rl.BLUE +// The colour of the overlay displaying the snap radius NODE_SNAP_COLOUR :: rl.PINK +// Background Colour BACKGROUND_COLOUR :: rl.LIGHTGRAY \ No newline at end of file diff --git a/common/structures.odin b/common/structures.odin index 4d21c59..39ca9e0 100644 --- a/common/structures.odin +++ b/common/structures.odin @@ -2,7 +2,10 @@ package common import rl "vendor:raylib" +// Stores data about intersections Intersection_Data :: struct { + // Index of the road that is intersected road: u32, + // The exact point of intersection point: rl.Vector2, } \ No newline at end of file diff --git a/simulator.odin b/simulator.odin index 2586337..9a5aace 100644 --- a/simulator.odin +++ b/simulator.odin @@ -8,6 +8,8 @@ import inf "infrastructure" // PLAN AREA // TODO implement deleting of roads +// TODO text/debug +// TODO full colour constant utilisation Simulator :: struct { // Stores all nodes @@ -36,7 +38,12 @@ init :: proc() -> Simulator { // Destructor deinit :: proc(self: ^Simulator) { self.temp_node_index = nil + delete(self.roads) + + for &node in self.nodes { + inf.node_deinit(&node) + } delete(self.nodes) }