From eee3897b856e2c58487a3e6aa631fed4e5adf8ed Mon Sep 17 00:00:00 2001 From: cmod31 Date: Fri, 10 Feb 2023 19:12:39 +0100 Subject: [PATCH] added y-sorting --- project.godot | 2 +- scenes/main.tscn | 11 ----------- scenes/overworld.tscn | 20 ++++++++++++++++++++ scenes/player.tscn | 1 - scenes/tiles/dialogdebug_cupcake.tscn | 5 ++--- scenes/worlds/first_world.tscn | 21 --------------------- tilesets/main_foreground.tres | 2 +- 7 files changed, 24 insertions(+), 38 deletions(-) delete mode 100644 scenes/main.tscn create mode 100644 scenes/overworld.tscn delete mode 100644 scenes/worlds/first_world.tscn diff --git a/project.godot b/project.godot index c3bc94c..26d4c2d 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="RPG Test gd4" -run/main_scene="res://scenes/main.tscn" +run/main_scene="res://scenes/overworld.tscn" config/features=PackedStringArray("4.0", "C#", "Forward Plus") config/icon="res://assets/textures/debug/dummy-player-normal.png" diff --git a/scenes/main.tscn b/scenes/main.tscn deleted file mode 100644 index 7c99b14..0000000 --- a/scenes/main.tscn +++ /dev/null @@ -1,11 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://2867aayx0skw"] - -[ext_resource type="PackedScene" uid="uid://bxaheg7l4h1ip" path="res://scenes/player.tscn" id="1_p5d84"] -[ext_resource type="PackedScene" uid="uid://cld0jncmsk1bj" path="res://scenes/worlds/first_world.tscn" id="2_x8nyb"] - -[node name="main" type="Node2D"] - -[node name="first_world" parent="." instance=ExtResource("2_x8nyb")] - -[node name="player" parent="." instance=ExtResource("1_p5d84")] -playerName = "Yannik" diff --git a/scenes/overworld.tscn b/scenes/overworld.tscn new file mode 100644 index 0000000..9f53e22 --- /dev/null +++ b/scenes/overworld.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=3 format=3 uid="uid://2867aayx0skw"] + +[ext_resource type="TileSet" uid="uid://txl24cadn8t4" path="res://tilesets/main_foreground.tres" id="1_tknx3"] +[ext_resource type="PackedScene" uid="uid://bxaheg7l4h1ip" path="res://scenes/player.tscn" id="2_0skrb"] + +[node name="overworld" type="Node2D"] +y_sort_enabled = true +metadata/_edit_lock_ = true + +[node name="tilemap" type="TileMap" parent="."] +y_sort_enabled = true +tile_set = ExtResource("1_tknx3") +cell_quadrant_size = 64 +format = 2 +layer_0/tile_data = PackedInt32Array(1, 0, 0, 65533, 0, 0, -3, 0, 0, -65535, 0, 0, -131070, 1, 131072, -131067, 1, 131072, -131074, 1, 131072, -262141, 1, 131072, 4, 1, 131072, -131078, 2, 65536) +metadata/_edit_lock_ = true + +[node name="player" parent="." instance=ExtResource("2_0skrb")] +playerName = "Yannik" +metadata/_edit_lock_ = true diff --git a/scenes/player.tscn b/scenes/player.tscn index 67644ab..89d4274 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -90,7 +90,6 @@ height = 45.968 [node name="player" type="CharacterBody2D"] process_mode = 1 -y_sort_enabled = true position = Vector2(-1, 0) floor_stop_on_slope = false script = ExtResource("1_qehox") diff --git a/scenes/tiles/dialogdebug_cupcake.tscn b/scenes/tiles/dialogdebug_cupcake.tscn index 0b667d3..ebf9d8d 100644 --- a/scenes/tiles/dialogdebug_cupcake.tscn +++ b/scenes/tiles/dialogdebug_cupcake.tscn @@ -7,7 +7,7 @@ size = Vector2(64, 17.25) [sub_resource type="RectangleShape2D" id="RectangleShape2D_d78tr"] -size = Vector2(64, 58) +size = Vector2(64, 64) [node name="dialogdebug_cupcake" type="StaticBody2D"] @@ -15,11 +15,10 @@ size = Vector2(64, 58) texture = ExtResource("1_imilm") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(0, 20.625) +position = Vector2(0, 23) shape = SubResource("RectangleShape2D_pchpi") [node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")] -position = Vector2(3, 0) file = "res://assets/lang/en/dialogue/npcs/villager_normal.json" title = "Debug cupcake" diff --git a/scenes/worlds/first_world.tscn b/scenes/worlds/first_world.tscn deleted file mode 100644 index 615dc43..0000000 --- a/scenes/worlds/first_world.tscn +++ /dev/null @@ -1,21 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://cld0jncmsk1bj"] - -[ext_resource type="TileSet" uid="uid://bduttqwwbt6lq" path="res://tilesets/main_background.tres" id="1_a172k"] -[ext_resource type="TileSet" uid="uid://txl24cadn8t4" path="res://tilesets/main_foreground.tres" id="2_kvjhj"] - -[node name="first_world" type="Node2D"] - -[node name="background" type="TileMap" parent="."] -tile_set = ExtResource("1_a172k") -cell_quadrant_size = 128 -format = 2 -layer_0/tile_data = PackedInt32Array(-65535, 65536, 1, -131071, 65536, 1, -65536, 65536, 1, -131072, 65536, 1, -1, 65536, 1, -65537, 65536, 1, 3, 131072, 1, -65533, 131072, 1, -131069, 131072, 1, 2, 65536, 1, -65534, 65536, 1, -131070, 65536, 1, 1, 65536, 1, 0, 65536, 1, 65535, 65536, 1, 65534, 65536, 1, -2, 65536, 1, -65538, 65536, 1, -65540, 65536, 1, -65541, 65536, 1, -5, 65536, 1, -6, 0, 1, -65542, 0, 1, 65530, 0, 1, 65531, 65536, 1, -4, 65536, 1, 65532, 65536, 1, -196605, 131072, 0, -196606, 65536, 0, -196607, 65536, 0, -196608, 65536, 0, -131073, 65536, 0, -131074, 65536, 0, 131070, 65536, 2, 131071, 65536, 2, 65536, 65536, 2, 65537, 65536, 2, 65538, 65536, 2, 65539, 131072, 2, 131069, 65536, 2, 65533, 65536, 1, -3, 65536, 1, -65539, 65536, 1, -131075, 65536, 0, -131076, 65536, 0, -131077, 65536, 0, -131078, 0, 0, 131068, 65536, 2, 131067, 65536, 2, 131066, 0, 2) - -[node name="foreground" type="TileMap" parent="."] -y_sort_enabled = true -tile_set = ExtResource("2_kvjhj") -cell_quadrant_size = 64 -format = 2 -layer_0/y_sort_enabled = true -layer_0/y_sort_origin = 40 -layer_0/tile_data = PackedInt32Array(1, 0, 0, 65533, 0, 0, -3, 0, 0, -65535, 0, 0, 65529, 1, 65536, 65541, 1, 65536, -196605, 1, 65536, 196603, 1, 65536, -196603, 1, 65536, -196600, 1, 65536, -131086, 2, 65536) diff --git a/tilesets/main_foreground.tres b/tilesets/main_foreground.tres index 24f656c..154c24d 100644 --- a/tilesets/main_foreground.tres +++ b/tilesets/main_foreground.tres @@ -10,7 +10,7 @@ scenes/0/scene = ExtResource("1_uxmn6") [sub_resource type="TileSetScenesCollectionSource" id="TileSetScenesCollectionSource_eskkr"] resource_name = "dialogdebug" -scenes/1/scene = ExtResource("2_0cov5") +scenes/2/scene = ExtResource("2_0cov5") [sub_resource type="TileSetScenesCollectionSource" id="TileSetScenesCollectionSource_xtxu0"] resource_name = "sounddebug"