SpringBlock.tscn 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [gd_scene load_steps=15 format=3 uid="uid://bx23j813jg0bl"]
  2. [ext_resource type="Texture2D" uid="uid://dnjx65qkbf1aq" path="res://Assets/Sprites/Blocks/SpringBlock.png" id="1_5ga5m"]
  3. [ext_resource type="Script" uid="uid://cdlufmypvdtun" path="res://Scripts/Classes/Blocks/SpringBlock.gd" id="1_omsgc"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_wexil"]
  5. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_wexil"]
  6. [ext_resource type="Script" uid="uid://cq6f682453q6o" path="res://Scripts/Classes/Components/ResourceSetter.gd" id="4_a8j4k"]
  7. [ext_resource type="Script" uid="uid://cmvlgsjmsk0v5" path="res://Scripts/Classes/Resources/ThemedResource.gd" id="5_3xejn"]
  8. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="7_3xejn"]
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_omsgc"]
  10. atlas = ExtResource("1_5ga5m")
  11. region = Rect2(16, 0, 16, 16)
  12. [sub_resource type="AtlasTexture" id="AtlasTexture_3aauc"]
  13. atlas = ExtResource("1_5ga5m")
  14. region = Rect2(0, 0, 16, 16)
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_a8j4k"]
  16. atlas = ExtResource("1_5ga5m")
  17. region = Rect2(0, 0, 16, 16)
  18. [sub_resource type="SpriteFrames" id="SpriteFrames_3xejn"]
  19. animations = [{
  20. "frames": [{
  21. "duration": 1.0,
  22. "texture": SubResource("AtlasTexture_omsgc")
  23. }, {
  24. "duration": 1.0,
  25. "texture": SubResource("AtlasTexture_3aauc")
  26. }],
  27. "loop": false,
  28. "name": &"Bounce",
  29. "speed": 15.0
  30. }, {
  31. "frames": [{
  32. "duration": 1.0,
  33. "texture": SubResource("AtlasTexture_a8j4k")
  34. }],
  35. "loop": true,
  36. "name": &"Idle",
  37. "speed": 5.0
  38. }]
  39. [sub_resource type="Resource" id="Resource_e7kaa"]
  40. script = ExtResource("5_3xejn")
  41. Overworld = SubResource("SpriteFrames_3xejn")
  42. metadata/_custom_type_script = "uid://cmvlgsjmsk0v5"
  43. [sub_resource type="RectangleShape2D" id="RectangleShape2D_e7kaa"]
  44. size = Vector2(16, 8)
  45. [sub_resource type="RectangleShape2D" id="RectangleShape2D_omsgc"]
  46. size = Vector2(14, 8)
  47. [node name="SpringBlock" type="AnimatableBody2D"]
  48. collision_layer = 6
  49. sync_to_physics = false
  50. script = ExtResource("1_omsgc")
  51. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  52. sprite_frames = SubResource("SpriteFrames_3xejn")
  53. animation = &"Bounce"
  54. autoplay = "Idle"
  55. script = ExtResource("2_wexil")
  56. do_offset = false
  57. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  58. [node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  59. script = ExtResource("4_a8j4k")
  60. node_to_affect = NodePath("..")
  61. property_name = "sprite_frames"
  62. themed_resource = SubResource("Resource_e7kaa")
  63. metadata/_custom_type_script = "uid://cq6f682453q6o"
  64. [node name="Collision" type="CollisionShape2D" parent="."]
  65. position = Vector2(0, 4)
  66. shape = SubResource("RectangleShape2D_e7kaa")
  67. [node name="PlayerDetection" type="Area2D" parent="."]
  68. position = Vector2(0, -4)
  69. script = ExtResource("3_wexil")
  70. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  71. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
  72. shape = SubResource("RectangleShape2D_omsgc")
  73. [node name="TrackJoint" type="Node" parent="."]
  74. script = ExtResource("7_3xejn")
  75. offset = Vector2(0, 0)
  76. disable_physics = false
  77. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  78. [connection signal="player_entered" from="PlayerDetection" to="." method="on_player_entered"]