Open Gerrudo opened 2 months ago
https://github.com/Gerrudo/reticulating-splines/commit/ccd74f48cf8bb27f4bafab5804a300cec7cdbfec Added a check for connected roads, currently getting IndexOutOfRangeException when going through the neighbouring tiles, need to limit it properly or foreach through the neighbours first.
Anything that works to stop it from trying to check an index out of range for neighbours, should be easy as there's only 4.
https://github.com/Gerrudo/reticulating-splines/commit/8d68692d154af3b522d42c1e9135f0a8d3e796d0 Buildings now spawn when any side is connected to road, this is controlled by isConnectedToRoad, tile is changed and calculations are done only when this is set to true for a given tile.
Next steps for this is to implement A* pathfinding for different building types, but I may pivot to another item for a while and come back to this one.
Loosely tied to #45
Roads should be able to link up different buildings, we can use this as a basis for pathfinding and making buildings into a connected state.
We can build a state system on top of this to decide functionally of buildings and even replicate this system onto possibly water pipes and power lines or even different transport like rail or walkable paths.
The system should be generic enough that we can apply different sprites/code to it for different purposes.