Skip to content

Commit a7010d0

Browse files
food-pleaseNathanLovato
authored andcommitted
Fix broken anims, add mouse input to Interactions
1 parent efcaed4 commit a7010d0

File tree

18 files changed

+189
-175
lines changed

18 files changed

+189
-175
lines changed
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
1-
[gd_scene load_steps=5 format=3 uid="uid://cdkha7cc72h35"]
1+
[gd_scene load_steps=3 format=3 uid="uid://cdkha7cc72h35"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_pdtfs"]
44
[ext_resource type="AnimationLibrary" uid="uid://dmmjb8ambpwar" path="res://assets/characters/default_animations/standard_animations.res" id="2_ljcdi"]
5-
[ext_resource type="Texture2D" uid="uid://doea2mk0aaedo" path="res://assets/characters/character_generic.png" id="3_cn4da"]
65

7-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tbyb3"]
8-
size = Vector2(16, 16)
9-
10-
[node name="GenericCharacterAnimation" instance=ExtResource("1_pdtfs")]
6+
[node name="GenericAnimation" instance=ExtResource("1_pdtfs")]
117

128
[node name="AnimationPlayer" parent="." index="0"]
13-
autoplay = "idle"
14-
speed_scale = 2.0
159
libraries = {
16-
"": ExtResource("2_ljcdi")
10+
&"": ExtResource("2_ljcdi")
1711
}
12+
autoplay = "idle"
13+
speed_scale = 2.0
1814

19-
[node name="CollisionShape2D" parent="Area2D" index="0"]
20-
shape = SubResource("RectangleShape2D_tbyb3")
21-
22-
[node name="Sprite" parent="GFX" index="0"]
23-
texture = ExtResource("3_cn4da")
24-
offset = Vector2(0, -6)
25-
region_enabled = true
15+
[node name="Sprite" parent="Anchor" index="0"]
2616
region_rect = Rect2(1, 1, 16, 16)

assets/characters/ghost_gfx.tscn

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://cgwailb13nkcd"]
1+
[gd_scene load_steps=5 format=3 uid="uid://cgwailb13nkcd"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_iqw7y"]
4-
[ext_resource type="Texture2D" uid="uid://dopua6orsf0bs" path="res://assets/characters/ ghost.atlastex" id="2_xwhv8"]
54

65
[sub_resource type="Animation" id="Animation_sr8xj"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -24,7 +23,7 @@ loop_mode = 1
2423
tracks/0/type = "value"
2524
tracks/0/imported = false
2625
tracks/0/enabled = true
27-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
26+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2827
tracks/0/interp = 1
2928
tracks/0/loop_wrap = true
3029
tracks/0/keys = {
@@ -40,20 +39,10 @@ _data = {
4039
&"idle": SubResource("Animation_maeh2")
4140
}
4241

43-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_b20ad"]
44-
size = Vector2(16, 16)
45-
4642
[node name="GhostGFX" instance=ExtResource("1_iqw7y")]
4743

4844
[node name="AnimationPlayer" parent="." index="0"]
4945
libraries = {
50-
"": SubResource("AnimationLibrary_6yooh")
46+
&"": SubResource("AnimationLibrary_6yooh")
5147
}
5248
autoplay = "idle"
53-
54-
[node name="CollisionShape2D" parent="Area2D" index="0"]
55-
shape = SubResource("RectangleShape2D_b20ad")
56-
57-
[node name="Sprite" parent="GFX" index="0"]
58-
texture = ExtResource("2_xwhv8")
59-
offset = Vector2(0, -6)

assets/characters/knight_gfx.tscn

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://se1wnxu5svgj"]
1+
[gd_scene load_steps=5 format=3 uid="uid://se1wnxu5svgj"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_c58iv"]
4-
[ext_resource type="Texture2D" uid="uid://ti2vhkpokeib" path="res://assets/characters/knight.atlastex" id="2_i5oqc"]
54

65
[sub_resource type="Animation" id="Animation_sr8xj"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -24,7 +23,7 @@ loop_mode = 1
2423
tracks/0/type = "value"
2524
tracks/0/imported = false
2625
tracks/0/enabled = true
27-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
26+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2827
tracks/0/interp = 1
2928
tracks/0/loop_wrap = true
3029
tracks/0/keys = {
@@ -40,20 +39,10 @@ _data = {
4039
&"idle": SubResource("Animation_maeh2")
4140
}
4241

43-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_b20ad"]
44-
size = Vector2(16, 16)
45-
4642
[node name="KnightGFX" instance=ExtResource("1_c58iv")]
4743

4844
[node name="AnimationPlayer" parent="." index="0"]
49-
autoplay = "idle"
5045
libraries = {
51-
"": SubResource("AnimationLibrary_6yooh")
46+
&"": SubResource("AnimationLibrary_6yooh")
5247
}
53-
54-
[node name="CollisionShape2D" parent="Area2D" index="0"]
55-
shape = SubResource("RectangleShape2D_b20ad")
56-
57-
[node name="Sprite" parent="GFX" index="0"]
58-
texture = ExtResource("2_i5oqc")
59-
offset = Vector2(0, -6)
48+
autoplay = "idle"

assets/characters/lady_gfx.tscn

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://kiwma43jc3n6"]
1+
[gd_scene load_steps=5 format=3 uid="uid://kiwma43jc3n6"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_lnhvj"]
4-
[ext_resource type="Texture2D" uid="uid://da8xa6fkwyv4r" path="res://assets/characters/thief.atlastex" id="2_5o3nk"]
54

65
[sub_resource type="Animation" id="Animation_r565k"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -25,7 +24,7 @@ step = 0.5
2524
tracks/0/type = "value"
2625
tracks/0/imported = false
2726
tracks/0/enabled = true
28-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
27+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2928
tracks/0/interp = 1
3029
tracks/0/loop_wrap = true
3130
tracks/0/keys = {
@@ -41,20 +40,10 @@ _data = {
4140
&"idle": SubResource("Animation_b16yu")
4241
}
4342

44-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1u5hk"]
45-
size = Vector2(16, 16)
46-
4743
[node name="LadyGFX" instance=ExtResource("1_lnhvj")]
4844

4945
[node name="AnimationPlayer" parent="." index="0"]
50-
autoplay = "idle"
5146
libraries = {
52-
"": SubResource("AnimationLibrary_fx0ff")
47+
&"": SubResource("AnimationLibrary_fx0ff")
5348
}
54-
55-
[node name="CollisionShape2D" parent="Area2D" index="0"]
56-
shape = SubResource("RectangleShape2D_1u5hk")
57-
58-
[node name="Sprite" parent="GFX" index="0"]
59-
texture = ExtResource("2_5o3nk")
60-
offset = Vector2(0, -6)
49+
autoplay = "idle"

assets/characters/monk_gfx.tscn

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://dqdk6eehxsrmn"]
1+
[gd_scene load_steps=5 format=3 uid="uid://dqdk6eehxsrmn"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_3s0fl"]
4-
[ext_resource type="Texture2D" uid="uid://2kiqbt7c1s65" path="res://assets/characters/monk.atlastex" id="2_h5x4o"]
54

65
[sub_resource type="Animation" id="Animation_r565k"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -25,7 +24,7 @@ step = 0.5
2524
tracks/0/type = "value"
2625
tracks/0/imported = false
2726
tracks/0/enabled = true
28-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
27+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2928
tracks/0/interp = 1
3029
tracks/0/loop_wrap = true
3130
tracks/0/keys = {
@@ -41,20 +40,10 @@ _data = {
4140
&"idle": SubResource("Animation_b16yu")
4241
}
4342

44-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1u5hk"]
45-
size = Vector2(16, 16)
46-
4743
[node name="MonkGFX" instance=ExtResource("1_3s0fl")]
4844

4945
[node name="AnimationPlayer" parent="." index="0"]
50-
autoplay = "idle"
5146
libraries = {
52-
"": SubResource("AnimationLibrary_fx0ff")
47+
&"": SubResource("AnimationLibrary_fx0ff")
5348
}
54-
55-
[node name="CollisionShape2D" parent="Area2D" index="0"]
56-
shape = SubResource("RectangleShape2D_1u5hk")
57-
58-
[node name="Sprite" parent="GFX" index="0"]
59-
texture = ExtResource("2_h5x4o")
60-
offset = Vector2(0, -6)
49+
autoplay = "idle"

assets/characters/smith_gfx.tscn

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://bvtk5qllej4b8"]
1+
[gd_scene load_steps=5 format=3 uid="uid://bvtk5qllej4b8"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_jgl7k"]
4-
[ext_resource type="Texture2D" uid="uid://b4py6kf410yhh" path="res://assets/characters/smith.atlastex" id="2_7h01k"]
54

65
[sub_resource type="Animation" id="Animation_h6akm"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -25,7 +24,7 @@ step = 0.5
2524
tracks/0/type = "value"
2625
tracks/0/imported = false
2726
tracks/0/enabled = true
28-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
27+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2928
tracks/0/interp = 1
3029
tracks/0/loop_wrap = true
3130
tracks/0/keys = {
@@ -41,20 +40,10 @@ _data = {
4140
&"idle": SubResource("Animation_rviym")
4241
}
4342

44-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_b20ad"]
45-
size = Vector2(16, 16)
46-
4743
[node name="KnightGFX" instance=ExtResource("1_jgl7k")]
4844

4945
[node name="AnimationPlayer" parent="." index="0"]
50-
autoplay = "idle"
5146
libraries = {
52-
"": SubResource("AnimationLibrary_y0jyp")
47+
&"": SubResource("AnimationLibrary_y0jyp")
5348
}
54-
55-
[node name="CollisionShape2D" parent="Area2D" index="0"]
56-
shape = SubResource("RectangleShape2D_b20ad")
57-
58-
[node name="Sprite" parent="GFX" index="0"]
59-
texture = ExtResource("2_7h01k")
60-
offset = Vector2(0, -6)
49+
autoplay = "idle"

assets/characters/wizard_gfx.tscn

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
[gd_scene load_steps=7 format=3 uid="uid://ccm8tsjysf8b5"]
1+
[gd_scene load_steps=5 format=3 uid="uid://ccm8tsjysf8b5"]
22

33
[ext_resource type="PackedScene" uid="uid://caxhff6by5nqu" path="res://src/field/gamepieces/animation/gamepiece_animation.tscn" id="1_7u2js"]
4-
[ext_resource type="Texture2D" uid="uid://8ry5inpldbfg" path="res://assets/characters/wizard.atlastex" id="2_othtp"]
54

65
[sub_resource type="Animation" id="Animation_8lv7x"]
76
length = 0.001
87
tracks/0/type = "value"
98
tracks/0/imported = false
109
tracks/0/enabled = true
11-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
10+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
1211
tracks/0/interp = 1
1312
tracks/0/loop_wrap = true
1413
tracks/0/keys = {
@@ -25,7 +24,7 @@ step = 0.5
2524
tracks/0/type = "value"
2625
tracks/0/imported = false
2726
tracks/0/enabled = true
28-
tracks/0/path = NodePath("GFX/Sprite:flip_h")
27+
tracks/0/path = NodePath("Anchor/Sprite:flip_h")
2928
tracks/0/interp = 1
3029
tracks/0/loop_wrap = true
3130
tracks/0/keys = {
@@ -41,20 +40,10 @@ _data = {
4140
&"idle": SubResource("Animation_f7y2d")
4241
}
4342

44-
[sub_resource type="RectangleShape2D" id="RectangleShape2D_b20ad"]
45-
size = Vector2(16, 16)
46-
4743
[node name="KnightGFX" instance=ExtResource("1_7u2js")]
4844

4945
[node name="AnimationPlayer" parent="." index="0"]
50-
autoplay = "idle"
5146
libraries = {
52-
"": SubResource("AnimationLibrary_hgdni")
47+
&"": SubResource("AnimationLibrary_hgdni")
5348
}
54-
55-
[node name="CollisionShape2D" parent="Area2D" index="0"]
56-
shape = SubResource("RectangleShape2D_b20ad")
57-
58-
[node name="Sprite" parent="GFX" index="0"]
59-
texture = ExtResource("2_othtp")
60-
offset = Vector2(0, -6)
49+
autoplay = "idle"

src/Main2.tscn

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[ext_resource type="TileSet" uid="uid://cnlvvllr0ici" path="res://src/field/gamepieces/controllers/cursor/tileset_cursor.tres" id="8_vw0ml"]
1414
[ext_resource type="Script" uid="uid://dwq2jtul5j1rc" path="res://src/field/gamepieces/controllers/cursor/field_cursor.gd" id="9_xqwga"]
1515
[ext_resource type="Script" uid="uid://vnofet0hi8mx" path="res://src/field/gamepieces/player_controller.gd" id="10_7v0vs"]
16-
[ext_resource type="Script" uid="uid://bm5b3nr6vn3da" path="res://src/field/gamepieces/controllers/path_loop_ai_controller.gd" id="13_xqwga"]
16+
[ext_resource type="PackedScene" uid="uid://oot0x5n44b2r" path="res://src/field/cutscenes/Interaction.tscn" id="15_l5lio"]
1717

1818
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u7xvm"]
1919
texture = ExtResource("2_dsdwj")
@@ -91,13 +91,10 @@ metadata/_edit_lock_ = true
9191
position = Vector2(56, 69.8)
9292
animation_scene = ExtResource("3_08ad2")
9393

94-
[node name="PathLoopController" type="Node2D" parent="Gamepieces/Gamepiece2" node_paths=PackedStringArray("path_to_follow")]
95-
script = ExtResource("13_xqwga")
96-
path_to_follow = NodePath("Line2D")
94+
[node name="Interaction" parent="." instance=ExtResource("15_l5lio")]
95+
position = Vector2(88, 40)
96+
scale = Vector2(1, 1)
9797

98-
[node name="Line2D" type="Line2D" parent="Gamepieces/Gamepiece2/PathLoopController"]
99-
points = PackedVector2Array(-0.400002, 2.2, 15, 2, 14.4, -46, -1.4, -45.8)
100-
width = 2.0
101-
102-
[node name="WaitTimer" type="Timer" parent="Gamepieces/Gamepiece2/PathLoopController"]
103-
wait_time = 2.0
98+
[node name="Interaction2" parent="." instance=ExtResource("15_l5lio")]
99+
position = Vector2(40, 40)
100+
scale = Vector2(1, 1)

src/common/directions.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ static func angle_to_direction(angle: float) -> Points:
2828
return Points.S
2929

3030
return Points.W
31+
32+
33+
static func vector_to_direction(vector: Vector2) -> Points:
34+
return angle_to_direction(vector.angle())

src/field/cutscenes/Interaction.tscn

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,14 @@ collision_mask = 8
1616
shape = SubResource("CircleShape2D_jn5tq")
1717
debug_color = Color(1, 0.929412, 0.631373, 0.419608)
1818

19+
[node name="Button" type="Button" parent="."]
20+
offset_left = -8.0
21+
offset_top = -8.0
22+
offset_right = 8.0
23+
offset_bottom = 8.0
24+
focus_mode = 0
25+
mouse_filter = 1
26+
flat = true
27+
1928
[connection signal="area_entered" from="InteractionArea2D" to="." method="_on_area_entered"]
2029
[connection signal="area_exited" from="InteractionArea2D" to="." method="_on_area_exited"]

0 commit comments

Comments
 (0)