Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | rafeu | |
Old Version | Published before Godot 3 was released. |
TL;DR: how should a group of units should go from a tile to another while :
1)being spread out on the destination tile
2)Being blocked by forest borders on tiles (impassable)
I’m doing a virtual version of a board game with troops moving from hex to hex, multiple together. I don’t know how I could manage so they are always spread out on a tile they move to. I already have the map in a tilemap:
^^Started from the hexagonal tiles demo^^
also, the troops shall not go through forest borders (to or from) unless when controlling a special tile with 2.
As of now, since you can’t have a script on a tile, I started a script on the tilemap with the passable borders var passableCase=[ [false,true,true,false,true,false], [true,true,true,true,true,true], [true,false,true,false,true,false], [false,true,false,false,false,false], [false,true,false,true,false,false], #Tile5 [false,true,true,false,true,false], [false,true,true,false,true,false], [true,true,true,true,true,true], [false,true,true,false,true,false], [false,true,false,true,false,false], #Tile10 [false,true,false,false,false,false], [false,true,true,false,true,true], [true,false,true,false,true,false], [true,true,true,true,true,true], [true,false,true,false,true,false], #Tile15 ]
As can be seen, not that good…
Hope I’m not too hard to understand; haven’t done as much godot programming as I would like.