Working on tilemap
This commit is contained in:
parent
ca715ff994
commit
57b312a3a5
@ -6,7 +6,7 @@
|
|||||||
[ext_resource path="res://MiscCodes/background_script.gd" type="Script" id=17]
|
[ext_resource path="res://MiscCodes/background_script.gd" type="Script" id=17]
|
||||||
[ext_resource path="res://pictures/tileset_images/interaction_map.png" type="Texture" id=18]
|
[ext_resource path="res://pictures/tileset_images/interaction_map.png" type="Texture" id=18]
|
||||||
|
|
||||||
[sub_resource type="TileSet" id=5]
|
[sub_resource type="TileSet" id=1]
|
||||||
0/name = "vegetation.png 0"
|
0/name = "vegetation.png 0"
|
||||||
0/texture = ExtResource( 4 )
|
0/texture = ExtResource( 4 )
|
||||||
0/tex_offset = Vector2( 0, 0 )
|
0/tex_offset = Vector2( 0, 0 )
|
||||||
@ -155,7 +155,7 @@ tile_data = PoolIntArray( 0, 0, 39, 1, 0, 39, 2, 0, 39, 3, 0, 39, 4, 0, 39, 5, 0
|
|||||||
script = ExtResource( 17 )
|
script = ExtResource( 17 )
|
||||||
|
|
||||||
[node name="vegetation" type="TileMap" parent="."]
|
[node name="vegetation" type="TileMap" parent="."]
|
||||||
tile_set = SubResource( 5 )
|
tile_set = SubResource( 1 )
|
||||||
cell_size = Vector2( 32, 32 )
|
cell_size = Vector2( 32, 32 )
|
||||||
format = 1
|
format = 1
|
||||||
tile_data = PoolIntArray( 1179654, 0, 8, 1179655, 0, 0, 1245190, 0, 4, 1245191, 0, 5, 2097157, 0, 2, 2097158, 0, 7, 2097159, 0, 5, 2097160, 0, 1, 2162693, 0, 7, 2162694, 0, 6, 2162695, 0, 1, 2162696, 0, 7, 2162697, 0, 3, 2162698, 0, 4, 2162699, 0, 3, 2162700, 0, 7, 2162701, 0, 8, 2162702, 0, 5, 2228227, 0, 7, 2228228, 0, 4, 2228229, 0, 4, 2228230, 0, 0, 2228231, 0, 2, 2228232, 0, 7, 2228233, 0, 7, 2228234, 0, 8, 2228235, 0, 1, 2228236, 0, 4, 2228237, 0, 2, 2228238, 0, 1, 2228239, 0, 4, 2293763, 0, 5, 2293764, 0, 0, 2293765, 0, 2, 2293767, 0, 5, 2293768, 0, 4, 2293769, 0, 1, 2293770, 0, 8, 2293771, 0, 2, 2293772, 0, 6, 2293773, 0, 4, 2293774, 0, 3, 2293775, 0, 3, 2359299, 0, 6, 2359300, 0, 4, 2359301, 0, 3, 2359302, 0, 3, 2359303, 0, 6, 2359304, 0, 3, 2359305, 0, 8, 2359306, 0, 7, 2359307, 0, 1, 2359308, 0, 4, 2359309, 0, 2, 2359310, 0, 3, 2359311, 0, 0, 2359312, 0, 0, 2424835, 0, 0, 2424836, 0, 3, 2424837, 0, 5, 2424838, 0, 3, 2424839, 0, 5, 2424840, 0, 4, 2424841, 0, 1, 2424842, 0, 0, 2424843, 0, 1, 2424844, 0, 0, 2424845, 0, 6, 2424846, 0, 7, 2424847, 0, 8, 2424848, 0, 1, 2424849, 0, 3, 2424851, 0, 4, 2424852, 0, 0, 2490371, 0, 7, 2490372, 0, 5, 2490373, 0, 5, 2490375, 0, 4, 2490376, 0, 1, 2490377, 0, 5, 2490378, 0, 1, 2490379, 0, 1, 2490380, 0, 3, 2490381, 0, 4, 2490382, 0, 6, 2490383, 0, 4, 2490384, 0, 0, 2490385, 0, 1, 2490388, 0, 4, 2555907, 0, 6, 2555908, 0, 0, 2555909, 0, 4, 2555910, 0, 0, 2555911, 0, 2, 2555912, 0, 2, 2555913, 0, 8, 2555914, 0, 2, 2555915, 0, 0, 2555916, 0, 6, 2555917, 0, 4, 2555918, 0, 1, 2555919, 0, 2, 2555920, 0, 6, 2555921, 0, 2, 2555922, 0, 8, 2621443, 0, 2, 2621444, 0, 8, 2621445, 0, 7, 2621446, 0, 0, 2621447, 0, 8, 2621448, 0, 8, 2621449, 0, 7, 2621450, 0, 0, 2621451, 0, 6, 2621452, 0, 6, 2621453, 0, 2, 2621454, 0, 5, 2621455, 0, 8, 2621456, 0, 7, 2621457, 0, 0, 2621458, 0, 8, 2621459, 0, 5, 2686980, 0, 3, 2686981, 0, 6, 2686982, 0, 1, 2686983, 0, 4, 2686984, 0, 0, 2686985, 0, 6, 2686986, 0, 5, 2686987, 0, 4, 2686988, 0, 1, 2686989, 0, 2, 2686990, 0, 8, 2686991, 0, 8, 2686992, 0, 8, 2686993, 0, 8, 2686994, 0, 4, 2752517, 0, 1, 2752518, 0, 4, 2752519, 0, 6, 2752520, 0, 8, 2752521, 0, 2, 2752522, 0, 6, 2752523, 0, 2, 2752524, 0, 8, 2752525, 0, 5, 2752526, 0, 8 )
|
tile_data = PoolIntArray( 1179654, 0, 8, 1179655, 0, 0, 1245190, 0, 4, 1245191, 0, 5, 2097157, 0, 2, 2097158, 0, 7, 2097159, 0, 5, 2097160, 0, 1, 2162693, 0, 7, 2162694, 0, 6, 2162695, 0, 1, 2162696, 0, 7, 2162697, 0, 3, 2162698, 0, 4, 2162699, 0, 3, 2162700, 0, 7, 2162701, 0, 8, 2162702, 0, 5, 2228227, 0, 7, 2228228, 0, 4, 2228229, 0, 4, 2228230, 0, 0, 2228231, 0, 2, 2228232, 0, 7, 2228233, 0, 7, 2228234, 0, 8, 2228235, 0, 1, 2228236, 0, 4, 2228237, 0, 2, 2228238, 0, 1, 2228239, 0, 4, 2293763, 0, 5, 2293764, 0, 0, 2293765, 0, 2, 2293767, 0, 5, 2293768, 0, 4, 2293769, 0, 1, 2293770, 0, 8, 2293771, 0, 2, 2293772, 0, 6, 2293773, 0, 4, 2293774, 0, 3, 2293775, 0, 3, 2359299, 0, 6, 2359300, 0, 4, 2359301, 0, 3, 2359302, 0, 3, 2359303, 0, 6, 2359304, 0, 3, 2359305, 0, 8, 2359306, 0, 7, 2359307, 0, 1, 2359308, 0, 4, 2359309, 0, 2, 2359310, 0, 3, 2359311, 0, 0, 2359312, 0, 0, 2424835, 0, 0, 2424836, 0, 3, 2424837, 0, 5, 2424838, 0, 3, 2424839, 0, 5, 2424840, 0, 4, 2424841, 0, 1, 2424842, 0, 0, 2424843, 0, 1, 2424844, 0, 0, 2424845, 0, 6, 2424846, 0, 7, 2424847, 0, 8, 2424848, 0, 1, 2424849, 0, 3, 2424851, 0, 4, 2424852, 0, 0, 2490371, 0, 7, 2490372, 0, 5, 2490373, 0, 5, 2490375, 0, 4, 2490376, 0, 1, 2490377, 0, 5, 2490378, 0, 1, 2490379, 0, 1, 2490380, 0, 3, 2490381, 0, 4, 2490382, 0, 6, 2490383, 0, 4, 2490384, 0, 0, 2490385, 0, 1, 2490388, 0, 4, 2555907, 0, 6, 2555908, 0, 0, 2555909, 0, 4, 2555910, 0, 0, 2555911, 0, 2, 2555912, 0, 2, 2555913, 0, 8, 2555914, 0, 2, 2555915, 0, 0, 2555916, 0, 6, 2555917, 0, 4, 2555918, 0, 1, 2555919, 0, 2, 2555920, 0, 6, 2555921, 0, 2, 2555922, 0, 8, 2621443, 0, 2, 2621444, 0, 8, 2621445, 0, 7, 2621446, 0, 0, 2621447, 0, 8, 2621448, 0, 8, 2621449, 0, 7, 2621450, 0, 0, 2621451, 0, 6, 2621452, 0, 6, 2621453, 0, 2, 2621454, 0, 5, 2621455, 0, 8, 2621456, 0, 7, 2621457, 0, 0, 2621458, 0, 8, 2621459, 0, 5, 2686980, 0, 3, 2686981, 0, 6, 2686982, 0, 1, 2686983, 0, 4, 2686984, 0, 0, 2686985, 0, 6, 2686986, 0, 5, 2686987, 0, 4, 2686988, 0, 1, 2686989, 0, 2, 2686990, 0, 8, 2686991, 0, 8, 2686992, 0, 8, 2686993, 0, 8, 2686994, 0, 4, 2752517, 0, 1, 2752518, 0, 4, 2752519, 0, 6, 2752520, 0, 8, 2752521, 0, 2, 2752522, 0, 6, 2752523, 0, 2, 2752524, 0, 8, 2752525, 0, 5, 2752526, 0, 8 )
|
||||||
|
@ -5,6 +5,7 @@ const WALK_SPEED = 200
|
|||||||
const interaction_circle_size = 150
|
const interaction_circle_size = 150
|
||||||
#onready var background_map = get_node("/root/base_scene/background")
|
#onready var background_map = get_node("/root/base_scene/background")
|
||||||
onready var background_map = get_parent().get_node("background")
|
onready var background_map = get_parent().get_node("background")
|
||||||
|
#onready var background_map = get_node("background")
|
||||||
onready var vegetation_map = get_parent().get_node("vegetation")
|
onready var vegetation_map = get_parent().get_node("vegetation")
|
||||||
onready var interaction_map = get_parent().get_node("interaction_map")
|
onready var interaction_map = get_parent().get_node("interaction_map")
|
||||||
onready var player_interaction_map = get_parent().get_node("player_interaction")
|
onready var player_interaction_map = get_parent().get_node("player_interaction")
|
||||||
@ -41,6 +42,8 @@ func _physics_process(delta):
|
|||||||
Global.current_camera.Update()
|
Global.current_camera.Update()
|
||||||
|
|
||||||
func InteractWithCell():
|
func InteractWithCell():
|
||||||
|
for _i in self.get_children():
|
||||||
|
print(_i)
|
||||||
print(background_map)
|
print(background_map)
|
||||||
print(interaction_map)
|
print(interaction_map)
|
||||||
var plant_cell_mouse = interaction_map.get_cell(int(world_position[0] / cell_size.x), int(world_position[0] / cell_size.y))
|
var plant_cell_mouse = interaction_map.get_cell(int(world_position[0] / cell_size.x), int(world_position[0] / cell_size.y))
|
||||||
|
@ -6,6 +6,7 @@ func load_scene(map_data):
|
|||||||
var map = scene.instance()
|
var map = scene.instance()
|
||||||
return map
|
return map
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
self.add_child(load_scene("res://Maps/river_intersection"))
|
var map = "res://Maps/river_intersection"
|
||||||
|
self.add_child(load_scene(map))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user