diff options
Diffstat (limited to 'client/gui/menus/main/background.gd')
| -rw-r--r-- | client/gui/menus/main/background.gd | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/client/gui/menus/main/background.gd b/client/gui/menus/main/background.gd index e2a0d3be..6bf31ef9 100644 --- a/client/gui/menus/main/background.gd +++ b/client/gui/menus/main/background.gd @@ -26,7 +26,7 @@ func _ready(): if !Global.on_vulkan(): environment.environment.tonemap_exposure = 0.25 - var tiles: Dictionary[Vector2i, Variant] = {} # : Dictionary[Vector2i, String?] + var tiles: Dictionary[Vector2i, Array] = {} # : Dictionary[Vector2i, Array[String]] var item_counters := [] for x in range(-10, 11): for y in range(-10, 11): @@ -37,19 +37,11 @@ func _ready(): if k > 0.4: tile = choose(CRATES) if randf() > 0.7 else "counter" if k > 0.6: tile = choose(TOOLS) if tile != null: - tiles[Vector2i(x,y)] = tile + tiles[Vector2i(x,y)] = [tile] if tile == "counter" and randf() > 0.5 and w > 0.45: item_counters.push_back(Vector2i(x, y)) - var get_tile := func (cs: Vector2i): - return tiles.get(cs) - for tile_pos: Vector2i in tiles.keys(): - var x := tile_pos.x - var y := tile_pos.y - var tile = get_tile.call(tile_pos) - if tile != null: - map.set_tile(Vector2i(x,y), tile, - [Vector2i(x,y-1),Vector2i(x-1,y),Vector2i(x,y+1),Vector2i(x+1,y)].map(get_tile)) - + for pos: Vector2i in tiles: + map.set_tiles(Vector2i(pos.x, pos.y), tiles[pos], tiles) map.flush() for v: Vector2i in item_counters: |