Gerrudo / reticulating-splines

An isometric city building game.
0 stars 0 forks source link

Allow for Roads to be drawn seamlessly #34

Closed Gerrudo closed 2 months ago

Gerrudo commented 2 months ago

We should be able to drag roads out to draw them and have the sprites switch accordingly

required for #35

Gerrudo commented 2 months ago

https://github.com/Gerrudo/reticulating-splines/commit/73f348842630ffd16bff2953534d1ebcb6f29613 Added a new tile sprite and some custom code for eventually drawing roads.

Asset could use some work but we at least have a starting intersection.

I'm not yet going to do diagonal roads, but it will be easy to implement, it just requires more sprites to be able to draw diagonally.

Image

Left to do:

Gerrudo commented 2 months ago

https://github.com/Gerrudo/reticulating-splines/commit/40dd9a05e7c3858f681d8bc8ff2c2e29bde77188 Added custom tile with it's configuration.

Still some issues to work out but getting there, difference being that these are tiles instead of game objects so treating them differently.

Also needed to add extra code to GridManager to draw the roads holding down 1 button.

https://github.com/Gerrudo/reticulating-splines/assets/43029469/cd3a0a51-9a40-4349-b153-d32fafd3de68

Gerrudo commented 2 months ago

https://github.com/Gerrudo/reticulating-splines/commit/180caab2379716e5a59cbcf48f3814783e3f553f Updated the road tile rules to make sense for Isometric Z as Y, updated CreateRoad() to use ScreenToWorldPoint instead of ScreenToViewportPoint, updated road sprites to use default slice/pivot point.