diff --git a/scenes/player.tscn b/scenes/player.tscn index f605755..99def12 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://src/scene-scripts/player.cs" id="1_qehox"] [ext_resource type="Texture2D" uid="uid://olceowuycu8c" path="res://assets/textures/debug/dummy-player-atlas.png" id="2_yu1q5"] -[ext_resource type="PackedScene" uid="uid://d6ngurhq1r5y" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"] +[ext_resource type="PackedScene" uid="uid://dcb1x11exmlab" path="res://scenes/gui/dialog_bubble.tscn" id="3_8f573"] [sub_resource type="AtlasTexture" id="AtlasTexture_tokqm"] atlas = ExtResource("2_yu1q5") @@ -85,11 +85,12 @@ animations = [{ }] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_38v5o"] -radius = 5.99732 +radius = 13.9973 height = 45.968 [node name="player" type="CharacterBody2D"] process_mode = 1 +y_sort_enabled = true script = ExtResource("1_qehox") [node name="rotation_center" type="Marker2D" parent="."] @@ -107,7 +108,7 @@ frames = SubResource("SpriteFrames_2x1cy") animation = &"move_down" [node name="collision_shape" type="CollisionShape2D" parent="."] -position = Vector2(3.72529e-09, 39) +position = Vector2(0, 31) rotation = 1.57345 shape = SubResource("CapsuleShape2D_38v5o") diff --git a/scenes/tiles/dialogdebug_cupcake.tscn b/scenes/tiles/dialogdebug_cupcake.tscn index 74c8ad2..800660e 100644 --- a/scenes/tiles/dialogdebug_cupcake.tscn +++ b/scenes/tiles/dialogdebug_cupcake.tscn @@ -4,7 +4,7 @@ [ext_resource type="PackedScene" uid="uid://hyhe4kitrbt6" path="res://scenes/dialog_trigger_area.tscn" id="2_blpmd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_pchpi"] -size = Vector2(64, 58.5) +size = Vector2(64, 17.25) [sub_resource type="RectangleShape2D" id="RectangleShape2D_d78tr"] size = Vector2(64, 58) @@ -15,6 +15,7 @@ size = Vector2(64, 58) texture = ExtResource("1_imilm") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 20.625) shape = SubResource("RectangleShape2D_pchpi") [node name="dialog_trigger_area" parent="." instance=ExtResource("2_blpmd")] diff --git a/scenes/worlds/first_world.tscn b/scenes/worlds/first_world.tscn index 56faee6..288ac5f 100644 --- a/scenes/worlds/first_world.tscn +++ b/scenes/worlds/first_world.tscn @@ -12,8 +12,10 @@ 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, 2, -65533, 131072, 1, -131069, 131072, 1, 2, 65536, 2, -65534, 65536, 1, -131070, 65536, 1, 1, 65536, 2, 0, 65536, 2, 65535, 65536, 2, 65534, 0, 2, -2, 0, 1, -65538, 0, 1, -65540, 131072, 0, -65541, 65536, 0, -5, 65536, 1, -6, 0, 1, -65542, 0, 0, 65530, 0, 2, 65531, 65536, 2, -4, 131072, 1, 65532, 131072, 2, -196605, 131072, 0, -196606, 65536, 0, -196607, 65536, 0, -196608, 65536, 0, -131073, 65536, 0, -131074, 0, 0) [node name="foreground" type="TileMap" parent="."] +y_sort_enabled = true tile_set = ExtResource("2_kvjhj") cell_quadrant_size = 64 format = 2 -layer_0/z_index = 1 +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/src/scene-scripts/gui/dialog_bubble.cs b/src/scene-scripts/gui/dialog_bubble.cs index 3dea9ad..96258e1 100644 --- a/src/scene-scripts/gui/dialog_bubble.cs +++ b/src/scene-scripts/gui/dialog_bubble.cs @@ -1,4 +1,3 @@ -//WORK IN PROGRESS this code is very messy and will be fixed when it works using Godot; using System; diff --git a/src/scene-scripts/player.cs b/src/scene-scripts/player.cs index c7b31e4..d5038ed 100644 --- a/src/scene-scripts/player.cs +++ b/src/scene-scripts/player.cs @@ -8,11 +8,13 @@ public partial class player : CharacterBody2D public Vector2 movement; public AnimatedSprite2D animatedSprite; public Marker2D rotCenter; + public RayCast2D rayCast; public override void _Ready() { animatedSprite = GetNode("animated_sprite_2d"); rotCenter = GetNode("rotation_center"); + rayCast = GetNode("rotation_center/ray_cast_2d"); } public void ChangeProcess(bool process) { @@ -27,10 +29,9 @@ public partial class player : CharacterBody2D } public override void _Process(double delta) { - //call event in raycasted object - /*if (Input.IsActionJustPressed("ui_accept") && rayCast.IsColliding()) - rayCast.GetCollider().Call("OnInteraction", playerName);*/ + if (Input.IsActionJustPressed("ui_accept") && rayCast.IsColliding()) + rayCast.GetCollider().Call("OnInteraction", playerName); //animation system (with controller support wich cant get normalized vector) if (movement.Length() != 0)