CastleBridge.tscn 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. [gd_scene load_steps=23 format=3 uid="uid://dtpyjucfl16sw"]
  2. [ext_resource type="Script" uid="uid://drigdwsriqtma" path="res://Scripts/Parts/CastleBridge.gd" id="1_7m65m"]
  3. [ext_resource type="Texture2D" uid="uid://boc6yagywb1lu" path="res://Assets/Sprites/Tilesets/Terrain/Castle.png" id="1_030qv"]
  4. [ext_resource type="PackedScene" uid="uid://c3mc7ptiywhvw" path="res://Scenes/Parts/CastleBridgeSegment.tscn" id="2_rdab3"]
  5. [ext_resource type="Texture2D" uid="uid://iiepujg1uywt" path="res://Assets/Sprites/Items/BridgeAxe.png" id="2_wg8ck"]
  6. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="4_s4k02"]
  7. [ext_resource type="Script" uid="uid://bdq0373j5n5o0" path="res://Scripts/Parts/CameraRightLimit.gd" id="4_tmf7w"]
  8. [ext_resource type="Script" uid="uid://cq6f682453q6o" path="res://Scripts/Classes/Components/ResourceSetter.gd" id="5_vt2ac"]
  9. [ext_resource type="Script" uid="uid://cmvlgsjmsk0v5" path="res://Scripts/Classes/Resources/ThemedResource.gd" id="8_geany"]
  10. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="9_m5y50"]
  11. [ext_resource type="JSON" path="res://Assets/Sprites/Items/BridgeAxe.json" id="10_kvynl"]
  12. [ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="10_wgdlx"]
  13. [ext_resource type="Script" uid="uid://cpwloakvp672a" path="res://Scripts/Parts/EditorVisibleNode.gd" id="11_puc3y"]
  14. [ext_resource type="Texture2D" uid="uid://dlldh5aks0wff" path="res://Assets/Sprites/Editor/GhostTile.png" id="12_do8w3"]
  15. [ext_resource type="Script" uid="uid://b8vmbtoaaq5nc" path="res://Scripts/Parts/EditorToggleDetection.gd" id="13_do8w3"]
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_7m65m"]
  17. atlas = ExtResource("2_wg8ck")
  18. region = Rect2(0, 0, 16, 16)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_tmf7w"]
  20. atlas = ExtResource("2_wg8ck")
  21. region = Rect2(16, 0, 16, 16)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_xijkc"]
  23. atlas = ExtResource("2_wg8ck")
  24. region = Rect2(32, 0, 16, 16)
  25. [sub_resource type="SpriteFrames" id="SpriteFrames_13fwi"]
  26. animations = [{
  27. "frames": [{
  28. "duration": 10.0,
  29. "texture": SubResource("AtlasTexture_7m65m")
  30. }, {
  31. "duration": 1.0,
  32. "texture": SubResource("AtlasTexture_tmf7w")
  33. }, {
  34. "duration": 1.0,
  35. "texture": SubResource("AtlasTexture_xijkc")
  36. }, {
  37. "duration": 1.0,
  38. "texture": SubResource("AtlasTexture_tmf7w")
  39. }],
  40. "loop": true,
  41. "name": &"default",
  42. "speed": 10.0
  43. }]
  44. [sub_resource type="RectangleShape2D" id="RectangleShape2D_7m65m"]
  45. size = Vector2(2, 8)
  46. [sub_resource type="Resource" id="Resource_8q7qv"]
  47. script = ExtResource("8_geany")
  48. Overworld = ExtResource("1_030qv")
  49. metadata/_custom_type_script = "uid://cmvlgsjmsk0v5"
  50. [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_tmf7w"]
  51. normal = Vector2(-1, 0)
  52. [sub_resource type="GDScript" id="GDScript_wgdlx"]
  53. script/source = "@tool
  54. extends Node
  55. @onready var bridge: Node2D = $\"../Bridge\"
  56. func _process(_delta: float) -> void:
  57. var idx := 0
  58. for i in bridge.get_children():
  59. if owner.length > idx:
  60. i.show()
  61. i.position.x = idx * -16 + 192
  62. else:
  63. i.hide()
  64. i.global_position.x = -999
  65. idx += 1
  66. "
  67. [node name="CastleBridge" type="Node2D" groups=["CastleBridges"]]
  68. process_mode = 3
  69. script = ExtResource("1_7m65m")
  70. [node name="Bridge" type="Node2D" parent="."]
  71. [node name="CastleBridgeSegment" parent="Bridge" instance=ExtResource("2_rdab3")]
  72. position = Vector2(192, 0)
  73. [node name="CastleBridgeSegment2" parent="Bridge" instance=ExtResource("2_rdab3")]
  74. position = Vector2(176, 0)
  75. [node name="CastleBridgeSegment3" parent="Bridge" instance=ExtResource("2_rdab3")]
  76. position = Vector2(160, 0)
  77. [node name="CastleBridgeSegment4" parent="Bridge" instance=ExtResource("2_rdab3")]
  78. position = Vector2(144, 0)
  79. [node name="CastleBridgeSegment5" parent="Bridge" instance=ExtResource("2_rdab3")]
  80. position = Vector2(128, 0)
  81. [node name="CastleBridgeSegment6" parent="Bridge" instance=ExtResource("2_rdab3")]
  82. position = Vector2(112, 0)
  83. [node name="CastleBridgeSegment7" parent="Bridge" instance=ExtResource("2_rdab3")]
  84. position = Vector2(96, 0)
  85. [node name="CastleBridgeSegment8" parent="Bridge" instance=ExtResource("2_rdab3")]
  86. position = Vector2(80, 0)
  87. [node name="CastleBridgeSegment9" parent="Bridge" instance=ExtResource("2_rdab3")]
  88. position = Vector2(64, 0)
  89. [node name="CastleBridgeSegment10" parent="Bridge" instance=ExtResource("2_rdab3")]
  90. position = Vector2(48, 0)
  91. [node name="CastleBridgeSegment11" parent="Bridge" instance=ExtResource("2_rdab3")]
  92. position = Vector2(32, 0)
  93. [node name="CastleBridgeSegment12" parent="Bridge" instance=ExtResource("2_rdab3")]
  94. position = Vector2(16, 0)
  95. [node name="CastleBridgeSegment13" parent="Bridge" instance=ExtResource("2_rdab3")]
  96. [node name="CastleBridgeSegment14" parent="Bridge" instance=ExtResource("2_rdab3")]
  97. visible = false
  98. position = Vector2(-999, 0)
  99. [node name="CastleBridgeSegment15" parent="Bridge" instance=ExtResource("2_rdab3")]
  100. visible = false
  101. position = Vector2(-999, 0)
  102. [node name="CastleBridgeSegment16" parent="Bridge" instance=ExtResource("2_rdab3")]
  103. visible = false
  104. position = Vector2(-999, 0)
  105. [node name="CastleBridgeSegment17" parent="Bridge" instance=ExtResource("2_rdab3")]
  106. visible = false
  107. position = Vector2(-999, 0)
  108. [node name="CastleBridgeSegment18" parent="Bridge" instance=ExtResource("2_rdab3")]
  109. visible = false
  110. position = Vector2(-999, 0)
  111. [node name="CastleBridgeSegment19" parent="Bridge" instance=ExtResource("2_rdab3")]
  112. visible = false
  113. position = Vector2(-999, 0)
  114. [node name="CastleBridgeSegment20" parent="Bridge" instance=ExtResource("2_rdab3")]
  115. visible = false
  116. position = Vector2(-999, 0)
  117. [node name="Axe" type="AnimatedSprite2D" parent="."]
  118. position = Vector2(208, -32)
  119. sprite_frames = SubResource("SpriteFrames_13fwi")
  120. autoplay = "default"
  121. frame_progress = 0.124132
  122. script = ExtResource("4_s4k02")
  123. do_offset = false
  124. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  125. [node name="Hitbox" type="Area2D" parent="Axe"]
  126. [node name="CollisionShape2D" type="CollisionShape2D" parent="Axe/Hitbox"]
  127. shape = SubResource("RectangleShape2D_7m65m")
  128. [node name="Sprite2D14" type="Sprite2D" parent="Axe"]
  129. position = Vector2(-16, 16)
  130. texture = ExtResource("1_030qv")
  131. region_enabled = true
  132. region_rect = Rect2(208, 128, 16, 16)
  133. region_filter_clip_enabled = true
  134. [node name="ResourceSetterNew" type="Node" parent="Axe/Sprite2D14" node_paths=PackedStringArray("node_to_affect")]
  135. script = ExtResource("5_vt2ac")
  136. node_to_affect = NodePath("..")
  137. property_name = "texture"
  138. themed_resource = SubResource("Resource_8q7qv")
  139. metadata/_custom_type_script = "uid://cq6f682453q6o"
  140. [node name="CameraRightLimit" type="Node2D" parent="Axe"]
  141. position = Vector2(24, 8)
  142. script = ExtResource("4_tmf7w")
  143. metadata/_custom_type_script = "uid://bdq0373j5n5o0"
  144. [node name="StaticBody2D" type="StaticBody2D" parent="Axe"]
  145. [node name="CollisionShape2D" type="CollisionShape2D" parent="Axe/StaticBody2D"]
  146. position = Vector2(8, 0)
  147. shape = SubResource("WorldBoundaryShape2D_tmf7w")
  148. [node name="ResourceSetterNew" type="Node" parent="Axe" node_paths=PackedStringArray("node_to_affect")]
  149. script = ExtResource("9_m5y50")
  150. node_to_affect = NodePath("..")
  151. property_name = "sprite_frames"
  152. resource_json = ExtResource("10_kvynl")
  153. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  154. [node name="Camera" type="Camera2D" parent="."]
  155. position = Vector2(216, -56)
  156. process_callback = 0
  157. limit_left = -256
  158. limit_top = -208
  159. limit_bottom = 32
  160. editor_draw_limits = true
  161. [node name="EditorPropertyExposer" type="Node" parent="."]
  162. script = ExtResource("10_wgdlx")
  163. properties = Array[String](["length"])
  164. metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
  165. [node name="Node" type="Node" parent="."]
  166. process_mode = 3
  167. script = SubResource("GDScript_wgdlx")
  168. [node name="LevelEditorVisibleNode" type="Node2D" parent="."]
  169. script = ExtResource("11_puc3y")
  170. metadata/_custom_type_script = "uid://cpwloakvp672a"
  171. [node name="Sprite2D" type="Sprite2D" parent="LevelEditorVisibleNode"]
  172. z_index = 4096
  173. position = Vector2(192, 0)
  174. texture = ExtResource("12_do8w3")
  175. [node name="EditorToggleDetection" type="Node" parent="."]
  176. script = ExtResource("13_do8w3")
  177. [connection signal="area_entered" from="Axe/Hitbox" to="." method="on_area_entered" flags=3]
  178. [connection signal="toggled" from="EditorToggleDetection" to="Axe/CameraRightLimit" method="_enter_tree"]