5959[ext_resource type ="PackedScene" uid ="uid://dgrrudegturnw" path ="res://scenes/game_elements/characters/npcs/townie.tscn" id ="54_duxxr" ]
6060[ext_resource type ="PackedScene" uid ="uid://daqd67aro1o1m" path ="res://scenes/game_elements/fx/time_and_weather/time_and_weather.tscn" id ="55_ojao8" ]
6161[ext_resource type ="Script" uid ="uid://cbj0406q05dly" path ="res://scenes/game_elements/props/hint/input_key/interact_input.gd" id ="55_wymun" ]
62+ [ext_resource type ="Texture2D" uid ="uid://ctwx8gghts62p" path ="res://assets/third_party/tiny-swords/Deco/06.png" id ="56_7kfal" ]
6263[ext_resource type ="Script" uid ="uid://edcifob4jc4s" path ="res://scenes/game_logic/talk_behavior.gd" id ="56_ojao8" ]
64+ [ext_resource type ="Texture2D" uid ="uid://ciwy8mfi0mv65" path ="res://scenes/quests/story_quests/after_the_tremor/0_intro/Imagenes/ball_free.png" id ="57_8dti7" ]
65+ [ext_resource type ="Texture2D" uid ="uid://pjdmmuwvkw14" path ="res://assets/third_party/tiny-swords-non-cc0/Terrain/Resources/Gold/Gold Stones/Gold Stone 6.png" id ="57_bu3x1" ]
66+ [ext_resource type ="Texture2D" uid ="uid://dlpjjca2udf42" path ="res://scenes/game_elements/props/button_item/components/button-shadow.png" id ="58_7hq0m" ]
6367[ext_resource type ="Script" uid ="uid://uaaaiviytliw" path ="res://scenes/world_map/components/quest_progress_unlocker.gd" id ="58_ojao8" ]
6468[ext_resource type ="Script" uid ="uid://dts1hwdy3phin" path ="res://scenes/menus/storybook/components/quest.gd" id ="59_qgpx3" ]
6569[ext_resource type ="Resource" uid ="uid://t50glay2iqhg" path ="res://scenes/quests/lore_quests/quest_002/quest.tres" id ="60_6b07c" ]
70+ [ext_resource type ="PackedScene" uid ="uid://dqo4d6mp4hwhi" path ="res://scenes/game_elements/props/repellable_box/repellable_box.tscn" id ="60_p2k53" ]
6671[ext_resource type ="Script" uid ="uid://0enyu5v4ra34" path ="res://scenes/game_elements/props/spawn_point/components/spawn_point.gd" id ="61_6b07c" ]
72+ [ext_resource type ="Texture2D" uid ="uid://uy2acspf6apo" path ="res://scenes/game_elements/props/lever/components/Lever.png" id ="62_p2k53" ]
6773[ext_resource type ="Script" uid ="uid://hqdquinbimce" path ="res://scenes/game_elements/props/teleporter/teleporter.gd" id ="62_t7c6s" ]
74+ [ext_resource type ="Script" uid ="uid://dunsvrhq42214" path ="res://scenes/game_elements/fx/shaker/components/shaker.gd" id ="63_a070f" ]
6875[ext_resource type ="PackedScene" uid ="uid://covsdqqsd6rsy" path ="res://scenes/game_elements/props/sign/sign.tscn" id ="64_uxfrp" ]
6976
7077[sub_resource type ="RectangleShape2D" id ="RectangleShape2D_duxxr" ]
@@ -82,6 +89,117 @@ size = Vector2(52, 61)
8289[sub_resource type ="RectangleShape2D" id ="RectangleShape2D_ulm71" ]
8390size = Vector2 (128 , 128 )
8491
92+ [sub_resource type ="PhysicsMaterial" id ="PhysicsMaterial_16ifw" ]
93+
94+ [sub_resource type ="GDScript" id ="GDScript_bu3x1" ]
95+ script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
96+ # SPDX-License-Identifier: MPL-2.0
97+ extends RigidBody2D
98+
99+ var tween : Tween
100+
101+
102+ func got_repelled (direction : Vector2 ) -> void :
103+ var hit_vector : Vector2 = direction * 300.0
104+ linear_velocity = Vector2 .ZERO
105+ apply_impulse (hit_vector )
106+ "
107+
108+ [sub_resource type ="CapsuleShape2D" id ="CapsuleShape2D_7n6eg" ]
109+ radius = 11.0
110+ height = 36.0
111+
112+ [sub_resource type ="PhysicsMaterial" id ="PhysicsMaterial_bu3x1" ]
113+ friction = 0.5
114+ bounce = 1.0
115+
116+ [sub_resource type ="GDScript" id ="GDScript_8dti7" ]
117+ script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
118+ # SPDX-License-Identifier: MPL-2.0
119+ extends RigidBody2D
120+
121+ var tween : Tween
122+
123+
124+ func got_repelled (direction : Vector2 ) -> void :
125+ var hit_vector : Vector2 = direction * 300.0
126+ linear_damp = 2
127+ linear_velocity = Vector2 .ZERO
128+ apply_impulse (hit_vector )
129+
130+
131+ func _on_sleeping_state_changed () -> void :
132+ linear_damp = 10
133+ "
134+
135+ [sub_resource type ="CircleShape2D" id ="CircleShape2D_bu3x1" ]
136+ radius = 19.104973
137+
138+ [sub_resource type ="GDScript" id ="GDScript_7kfal" ]
139+ script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
140+ # SPDX-License-Identifier: MPL-2.0
141+ extends RigidBody2D
142+
143+
144+ func get_closest_axis (vector : Vector2 ) -> Vector2 :
145+ if abs (vector .x ) > abs (vector .y ):
146+ # Closer to Horizontal (X-axis)
147+ return Vector2 (sign (vector .x ), 0 )
148+ else :
149+ # Closer to Vertical (Y-axis)
150+ return Vector2 (0 , sign (vector .y ))
151+
152+
153+ func got_repelled (direction : Vector2 ) -> void :
154+ var hit_vector : Vector2 = get_closest_axis (direction ) * 100.0
155+ linear_velocity = Vector2 .ZERO
156+ apply_impulse (hit_vector )
157+ "
158+
159+ [sub_resource type ="CapsuleShape2D" id ="CapsuleShape2D_bu3x1" ]
160+ radius = 19.0
161+ height = 64.0
162+
163+ [sub_resource type ="GDScript" id ="GDScript_p2k53" ]
164+ script/source = "# SPDX-FileCopyrightText: The Threadbare Authors
165+ # SPDX-License-Identifier: MPL-2.0
166+ extends StaticBody2D
167+
168+ const FRAME_FOR_SIDE : Dictionary [Enums .LookAtSide , int ] = {
169+ Enums .LookAtSide .LEFT : 0 ,
170+ Enums .LookAtSide .RIGHT : 1 ,
171+ }
172+
173+ @onready var lever_sprite : Sprite2D = $ LeverSprite
174+ @onready var shaker : Shaker = $ Shaker
175+
176+ var lever_side : Enums .LookAtSide = Enums .LookAtSide .LEFT :
177+ set = set_lever_side
178+
179+ func set_lever_side (new_side : Enums .LookAtSide ) -> void :
180+ lever_side = new_side
181+ lever_sprite .frame = FRAME_FOR_SIDE [lever_side ]
182+
183+ func _ready () -> void :
184+ set_lever_side (lever_side )
185+
186+
187+ func got_repelled (direction : Vector2 ) -> void :
188+ var sign_x := signf (direction .x )
189+ var new_side : Enums .LookAtSide
190+ if sign_x == 1 :
191+ new_side = Enums .LookAtSide .RIGHT
192+ elif sign_x == - 1 :
193+ new_side = Enums .LookAtSide .LEFT
194+ if new_side == lever_side :
195+ shaker .shake ()
196+ else :
197+ lever_side = new_side
198+ "
199+
200+ [sub_resource type ="CapsuleShape2D" id ="CapsuleShape2D_p2k53" ]
201+ height = 58.0
202+
85203[node name ="FraysEnd" type ="Node2D" unique_id =1849947277 ]
86204script = ExtResource ("1_4gse6" )
87205metadata/_edit_lock_ = true
@@ -125,7 +243,7 @@ tile_map_data = PackedByteArray("AAAaAAYABgACAAAAAAAaAAcABgACAAIAAAAZAAcABgABAAI
125243tile_set = ExtResource ("7_r1ek1" )
126244
127245[node name ="Paths_Level1" type ="TileMapLayer" parent ="TileMapLayers" unique_id =971351640 ]
128- tile_map_data = PackedByteArray ("AAARAA0AAQAHAAIAAAARAAwAAQAHAAEAAAAQAA0AAQAGAAIAAAAQAAwAAQAGAAEAAAAPAA4AAQAIAAEAAAAPAA0AAQAGAAEAAAAPAAwAAQAGAAEAAAAOAA0AAQAGAAIAAAAOAAwAAQAGAAEAAAANAA0AAQAFAAIAAAANAAwAAQAFAAEAAAARAAsAAQAHAAEAAAAQAAsAAQAGAAEAAAAPABEAAQAIAAEAAAAPABAAAQAIAAEAAAAPAA8AAQAIAAEAAAAPAAsAAQAGAAEAAAAOAAsAAQAGAAEAAAANAAsAAQAFAAEAAAAPABkAAQAHAAIAAAAPABgAAQAIAAEAAAAOABkAAQAGAAMAAAAPABcAAQAIAAAAAAAPABMAAQAIAAIAAAABABkAAQAGAAAAAAACABkAAQAGAAAAAAADABkAAQAGAAAAAAAEABkAAQAGAAMAAAAFABkAAQAGAAMAAAAGABkAAQAGAAMAAAAHABkAAQAGAAMAAAAIABkAAQAGAAMAAAAJABkAAQAGAAMAAAAKABkAAQAGAAMAAAALABkAAQAGAAMAAAAMABkAAQAGAAMAA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HAAIAAAAPABIAAQAGAAEAAAARAAoAAQAHAAEAAAANAAoAAQAFAAEAAAANAAkAAQAFAAAAAAAOAAkAAQAGAAAAAAAPAAkAAQAGAAAAAAAQAAkAAQAGAAAAAAARAAkAAQAHAAAAAAAOAAoAAQAGAAEAAAAPAAoAAQAGAAEAAAAQAAoAAQAGAAEAAAAOABMAAQAFAAIAAAAQABMAAQAHAAIAAAAOABIAAQAFAAAAAAAQABIAAQAHAAAAAAA =" )
129247tile_set = ExtResource ("7_r1ek1" )
130248
131249[node name ="Paths_Level2" type ="TileMapLayer" parent ="TileMapLayers" unique_id =1784740911 ]
@@ -1144,6 +1262,124 @@ shape = SubResource("RectangleShape2D_ulm71")
11441262position = Vector2 (95 , 664 )
11451263text = "West End"
11461264
1265+ [node name ="RepellableRock" type ="RigidBody2D" parent ="OnTheGround" unique_id =1901173256 ]
1266+ editor_description = "A repellable rock.
1267+
1268+ It's in collision layer repellable for it to work, and has a got_repelled() method defined.
1269+
1270+ It has some dumping to simulate friction that's why it stops (unlike the ice cube)."
1271+ position = Vector2 (913 , 868 )
1272+ collision_layer = 768
1273+ collision_mask = 531
1274+ physics_material_override = SubResource ("PhysicsMaterial_16ifw" )
1275+ lock_rotation = true
1276+ linear_damp = 2.0
1277+ script = SubResource ("GDScript_bu3x1" )
1278+
1279+ [node name ="Sprite2D" type ="Sprite2D" parent ="OnTheGround/RepellableRock" unique_id =513881379 ]
1280+ position = Vector2 (-2 , -3 )
1281+ texture = ExtResource ("56_7kfal" )
1282+
1283+ [node name ="CollisionShape2D" type ="CollisionShape2D" parent ="OnTheGround/RepellableRock" unique_id =589342826 ]
1284+ rotation = -1.5707964
1285+ shape = SubResource ("CapsuleShape2D_7n6eg" )
1286+
1287+ [node name ="BallAnchor" type ="Node2D" parent ="OnTheGround" unique_id =1725206225 ]
1288+ position = Vector2 (1136 , 1007 )
1289+
1290+ [node name ="Sprite2D" type ="Sprite2D" parent ="OnTheGround/BallAnchor" unique_id =2045011868 ]
1291+ position = Vector2 (0 , -30 )
1292+ scale = Vector2 (2.489 , 2 )
1293+ texture = ExtResource ("58_7hq0m" )
1294+ hframes = 4
1295+
1296+ [node name ="BallSprite" type ="Sprite2D" parent ="OnTheGround/BallAnchor" unique_id =1585779611 ]
1297+ position = Vector2 (0 , -17 )
1298+ scale = Vector2 (0.18770815 , 0.18770815 )
1299+ texture = ExtResource ("57_8dti7" )
1300+
1301+ [node name ="RepellableBall" type ="RigidBody2D" parent ="OnTheGround" unique_id =1394157854 ]
1302+ editor_description = "A repellable ball.
1303+ "
1304+ position = Vector2 (1136 , 1007 )
1305+ scale = Vector2 (0.99999994 , 0.99999994 )
1306+ collision_layer = 256
1307+ collision_mask = 531
1308+ mass = 0.1
1309+ physics_material_override = SubResource ("PhysicsMaterial_bu3x1" )
1310+ linear_damp = 20.0
1311+ angular_damp = 2.0
1312+ script = SubResource ("GDScript_8dti7" )
1313+
1314+ [node name ="CollisionShape2D" type ="CollisionShape2D" parent ="OnTheGround/RepellableBall" unique_id =271750635 ]
1315+ rotation = -1.5707964
1316+ shape = SubResource ("CircleShape2D_bu3x1" )
1317+ debug_color = Color (0.9570816 , 1 .0588765e-06, 0.5370912 , 0.41960785 )
1318+
1319+ [node name ="RemoteTransform2D" type ="RemoteTransform2D" parent ="OnTheGround/RepellableBall" unique_id =1152753866 ]
1320+ position = Vector2 (-1 .1920929e-07, -1 .9073486e-06)
1321+ scale = Vector2 (0.18770815 , 0.18770815 )
1322+ remote_path = NodePath ("../../BallAnchor" )
1323+ update_rotation = false
1324+ update_scale = false
1325+
1326+ [node name ="RemoteTransform2D2" type ="RemoteTransform2D" parent ="OnTheGround/RepellableBall" unique_id =650646433 ]
1327+ position = Vector2 (-1 .1920929e-07, -1 .9073486e-06)
1328+ scale = Vector2 (0.18770815 , 0.18770815 )
1329+ remote_path = NodePath ("../../BallAnchor/BallSprite" )
1330+ update_position = false
1331+ update_scale = false
1332+
1333+ [node name ="RepellableIceCube" type ="RigidBody2D" parent ="OnTheGround" unique_id =1744685581 ]
1334+ editor_description = "A repellable ice cube.
1335+
1336+ The got_repelled() method constrains the direction to the 4 axis (top, down, left, right).
1337+
1338+ Has no damping so it moves until it hits a wall or something."
1339+ position = Vector2 (1204 , 899 )
1340+ collision_layer = 768
1341+ collision_mask = 531
1342+ lock_rotation = true
1343+ script = SubResource ("GDScript_7kfal" )
1344+
1345+ [node name ="Sprite2D" type ="Sprite2D" parent ="OnTheGround/RepellableIceCube" unique_id =276581240 ]
1346+ position = Vector2 (2 , -5 )
1347+ texture = ExtResource ("57_bu3x1" )
1348+
1349+ [node name ="CollisionShape2D" type ="CollisionShape2D" parent ="OnTheGround/RepellableIceCube" unique_id =1875420561 ]
1350+ rotation = -1.5707964
1351+ shape = SubResource ("CapsuleShape2D_bu3x1" )
1352+
1353+ [node name ="RepellableBox" parent ="OnTheGround" unique_id =1805651676 node_paths =PackedStringArray ("constrain_layer" ) instance =ExtResource ("60_p2k53" )]
1354+ position = Vector2 (990 , 1256 )
1355+ constrain_layer = NodePath ("../../TileMapLayers/Paths_Level1" )
1356+
1357+ [node name ="RepellableBox2" parent ="OnTheGround" unique_id =2072092672 node_paths =PackedStringArray ("constrain_layer" ) instance =ExtResource ("60_p2k53" )]
1358+ position = Vector2 (932 , 1191 )
1359+ constrain_layer = NodePath ("../../TileMapLayers/Paths_Level1" )
1360+
1361+ [node name ="RepellableLever" type ="StaticBody2D" parent ="OnTheGround" unique_id =1178804777 ]
1362+ position = Vector2 (747 , 914 )
1363+ collision_layer = 768
1364+ collision_mask = 0
1365+ script = SubResource ("GDScript_p2k53" )
1366+
1367+ [node name ="LeverSprite" type ="Sprite2D" parent ="OnTheGround/RepellableLever" unique_id =118513672 ]
1368+ position = Vector2 (0 , -10 )
1369+ texture = ExtResource ("62_p2k53" )
1370+ hframes = 2
1371+
1372+ [node name ="CollisionShape2D" type ="CollisionShape2D" parent ="OnTheGround/RepellableLever" unique_id =287400683 ]
1373+ rotation = -1.5707964
1374+ shape = SubResource ("CapsuleShape2D_p2k53" )
1375+
1376+ [node name ="Shaker" type ="Node2D" parent ="OnTheGround/RepellableLever" unique_id =2090116419 node_paths =PackedStringArray ("target" )]
1377+ script = ExtResource ("63_a070f" )
1378+ target = NodePath (".." )
1379+ duration = 0.5
1380+ frequency = 30.0
1381+ metadata/_custom_type_script = "uid://dunsvrhq42214"
1382+
11471383[node name ="ScreenOverlay" type ="CanvasLayer" parent ="." unique_id =1144668032 ]
11481384
11491385[node name ="HBoxContainer" type ="HBoxContainer" parent ="ScreenOverlay" unique_id =1583452192 ]
@@ -1209,3 +1445,5 @@ position = Vector2(62, 1747)
12091445[connection signal ="interaction_started" from ="OnTheGround/NPCs/GardenerA/InteractArea" to ="OnTheGround/NPCs/GardenerA" method ="_on_interact_area_interaction_started" ]
12101446[connection signal ="interaction_ended" from ="OnTheGround/Tutorial/TutorialGuy/InteractArea" to ="OnTheGround/Tutorial/TutorialGuy" method ="_on_interact_area_interaction_ended" ]
12111447[connection signal ="interaction_started" from ="OnTheGround/Tutorial/TutorialGuy/InteractArea" to ="OnTheGround/Tutorial/TutorialGuy" method ="_on_interact_area_interaction_started" ]
1448+ [connection signal ="sleeping_state_changed" from ="OnTheGround/RepellableRock" to ="." method ="_on_repellable_rock_sleeping_state_changed" ]
1449+ [connection signal ="sleeping_state_changed" from ="OnTheGround/RepellableBall" to ="OnTheGround/RepellableBall" method ="_on_sleeping_state_changed" ]
0 commit comments