`extends TileMap
@export var gridSizeX : int
@export var gridSizeY : int
var dic = {}
var coords : Vector2
var is_Empty : bool
var NwborderX : int = 4
var NwborderY : int = 24
func _ready():
#PLACE GROUND TILES =====================================
for x in gridSizeX:
for y in gridSizeY:
dic[str(Vector2(x,y))] = {
"Tile": "Ground",
"Position": str(Vector2(x,y))
}
is_Empty = true
set_cell(0, Vector2(x,y), 0, Vector2i(0,0), 0)
#print(dic[Position], is_Empty)
#PLACE BORDER TILES ======================================
for i in NwborderX:
for j in NwborderY:
dic[str(Vector2(i,j))] = {
"Tile": "Border",
"Position": str(Vector2(i,j))
}
set_cell(0, Vector2(i -4,j -4), 1, Vector2i(0,0), 1)
set_cell(0, Vector2(i + 20, j ), 1, Vector2i(0,0), 1)
set_cell(0, Vector2(j - 4, i +20), 1, Vector2i(0,0), 1)
set_cell(0, Vector2(j , i -4), 1, Vector2i(0,0), 1)
#PLACE HQ IN CENTRE =======================================
set_cell(2, Vector2(gridSizeX/2 - 3, gridSizeY/2 - 3), 2, Vector2i(0,0), 2)
#===========================================================
#TODO
#Is_Empty = false'
Hi, how can I set the cells (4x4) bool to true, with the HQ building ontop of them?
Many thanks.