RingOfRaces/Other/base_tilemap/init.gd

22 lines
661 B
GDScript3
Raw Normal View History

2021-04-23 20:16:43 +00:00
extends Node2D
func load_scene(map_data):
$background.tile_set = load("base_tilemap/tilesets/background_ts.tres")
$vegetation.tile_set = load("res://river_intersection_home2.tscn::1")
2021-05-26 20:02:51 +00:00
2021-04-23 20:16:43 +00:00
for x in range(map_data.width):
for y in range(map_data.height):
$background.set_cell(x, y, map_data.background_map[x][y])
2021-05-26 20:02:51 +00:00
$vegetation.set_cell(x, y, -1)
$interaction_map.set_cell(x, y, -1)
$player_interaction.set_cell(x, y, -1)
2021-04-23 20:16:43 +00:00
func _ready():
var scene = load("res://Maps/test_scene.tscn")
var map = scene.instance()
#for c in map.get_children():
self.add_child(map)
# for c in self.get_childeren():
# print(c)
# pass # Replace with function body.