TrickBlock.tscn 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. [gd_scene load_steps=15 format=3 uid="uid://cpsdyhprded5d"]
  2. [ext_resource type="Script" uid="uid://cn8jml0dmf128" path="res://Scripts/Classes/Blocks/FallThroughBlock.gd" id="1_k7nc4"]
  3. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_aqge3"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_mdw74"]
  5. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="4_6pcvn"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/TrickBlock.json" id="4_aqge3"]
  7. [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_hyhae"]
  8. [sub_resource type="AtlasTexture" id="AtlasTexture_2ob4o"]
  9. atlas = SubResource("CompressedTexture2D_hyhae")
  10. region = Rect2(0, 0, 16, 16)
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_byvq0"]
  12. atlas = SubResource("CompressedTexture2D_hyhae")
  13. region = Rect2(48, 0, 16, 16)
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_w5se2"]
  15. atlas = SubResource("CompressedTexture2D_hyhae")
  16. region = Rect2(32, 0, 16, 16)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_6idsv"]
  18. atlas = SubResource("CompressedTexture2D_hyhae")
  19. region = Rect2(16, 0, 16, 16)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_1v6hd"]
  21. atlas = SubResource("CompressedTexture2D_hyhae")
  22. region = Rect2(0, 0, 16, 16)
  23. [sub_resource type="SpriteFrames" id="SpriteFrames_7od47"]
  24. animations = [{
  25. "frames": [{
  26. "duration": 1.0,
  27. "texture": SubResource("AtlasTexture_2ob4o")
  28. }],
  29. "loop": true,
  30. "name": &"Idle",
  31. "speed": 5.0
  32. }, {
  33. "frames": [{
  34. "duration": 1.0,
  35. "texture": SubResource("AtlasTexture_byvq0")
  36. }, {
  37. "duration": 1.0,
  38. "texture": SubResource("AtlasTexture_w5se2")
  39. }, {
  40. "duration": 1.0,
  41. "texture": SubResource("AtlasTexture_6idsv")
  42. }, {
  43. "duration": 1.0,
  44. "texture": SubResource("AtlasTexture_1v6hd")
  45. }],
  46. "loop": true,
  47. "name": &"Turn",
  48. "speed": 15.0
  49. }]
  50. [sub_resource type="RectangleShape2D" id="RectangleShape2D_tjbwr"]
  51. size = Vector2(16, 16)
  52. [sub_resource type="RectangleShape2D" id="RectangleShape2D_e7ak7"]
  53. size = Vector2(16, 16)
  54. [node name="TrickBlock" type="StaticBody2D"]
  55. collision_layer = 6
  56. collision_mask = 0
  57. script = ExtResource("1_k7nc4")
  58. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  59. sprite_frames = SubResource("SpriteFrames_7od47")
  60. animation = &"Turn"
  61. autoplay = "Idle"
  62. script = ExtResource("3_aqge3")
  63. do_offset = false
  64. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  65. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  66. script = ExtResource("3_mdw74")
  67. node_to_affect = NodePath("..")
  68. property_name = "sprite_frames"
  69. resource_json = ExtResource("4_aqge3")
  70. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  71. [node name="Collision" type="CollisionShape2D" parent="."]
  72. shape = SubResource("RectangleShape2D_tjbwr")
  73. [node name="PlayerDetection" type="Area2D" parent="."]
  74. script = ExtResource("4_6pcvn")
  75. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  76. [node name="Collision" type="CollisionShape2D" parent="PlayerDetection"]
  77. position = Vector2(0, -2)
  78. shape = SubResource("RectangleShape2D_e7ak7")
  79. [connection signal="player_entered" from="PlayerDetection" to="." method="on_player_entered"]
  80. [connection signal="player_exited" from="PlayerDetection" to="." method="on_player_exited"]