SwitchSpikeBlock.tscn 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. [gd_scene load_steps=17 format=3 uid="uid://d2ainv86lt68a"]
  2. [ext_resource type="PackedScene" uid="uid://by6ndsjhlkmbt" path="res://Scenes/Prefabs/Blocks/BooRaceBlocks/BooOnOffBlock.tscn" id="1_qn0kk"]
  3. [ext_resource type="Texture2D" uid="uid://cv27sth0k3amk" path="res://Assets/Sprites/Blocks/SwitchSpike.png" id="2_kmalu"]
  4. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/SwitchSpikeBlock.json" id="3_gfl4j"]
  5. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_kmalu"]
  6. [sub_resource type="AtlasTexture" id="AtlasTexture_m1hcn"]
  7. atlas = ExtResource("2_kmalu")
  8. region = Rect2(80, 0, 16, 16)
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_prw4m"]
  10. atlas = ExtResource("2_kmalu")
  11. region = Rect2(96, 0, 16, 16)
  12. [sub_resource type="AtlasTexture" id="AtlasTexture_ieqkm"]
  13. atlas = ExtResource("2_kmalu")
  14. region = Rect2(112, 0, 16, 16)
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_y0v5j"]
  16. atlas = ExtResource("2_kmalu")
  17. region = Rect2(0, 0, 16, 16)
  18. [sub_resource type="AtlasTexture" id="AtlasTexture_boqyf"]
  19. atlas = ExtResource("2_kmalu")
  20. region = Rect2(16, 0, 16, 16)
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_m8vhp"]
  22. atlas = ExtResource("2_kmalu")
  23. region = Rect2(32, 0, 16, 16)
  24. [sub_resource type="AtlasTexture" id="AtlasTexture_yyfct"]
  25. atlas = ExtResource("2_kmalu")
  26. region = Rect2(48, 0, 16, 16)
  27. [sub_resource type="AtlasTexture" id="AtlasTexture_tnmt2"]
  28. atlas = ExtResource("2_kmalu")
  29. region = Rect2(64, 0, 16, 16)
  30. [sub_resource type="AtlasTexture" id="AtlasTexture_gfl4j"]
  31. atlas = ExtResource("2_kmalu")
  32. region = Rect2(0, 0, 16, 16)
  33. [sub_resource type="SpriteFrames" id="SpriteFrames_cjipk"]
  34. animations = [{
  35. "frames": [{
  36. "duration": 1.0,
  37. "texture": SubResource("AtlasTexture_m1hcn")
  38. }, {
  39. "duration": 1.0,
  40. "texture": SubResource("AtlasTexture_prw4m")
  41. }, {
  42. "duration": 1.0,
  43. "texture": SubResource("AtlasTexture_ieqkm")
  44. }, {
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_y0v5j")
  47. }],
  48. "loop": false,
  49. "name": &"Off",
  50. "speed": 15.0
  51. }, {
  52. "frames": [{
  53. "duration": 1.0,
  54. "texture": SubResource("AtlasTexture_boqyf")
  55. }, {
  56. "duration": 1.0,
  57. "texture": SubResource("AtlasTexture_m8vhp")
  58. }, {
  59. "duration": 1.0,
  60. "texture": SubResource("AtlasTexture_yyfct")
  61. }, {
  62. "duration": 1.0,
  63. "texture": SubResource("AtlasTexture_tnmt2")
  64. }],
  65. "loop": false,
  66. "name": &"On",
  67. "speed": 15.0
  68. }, {
  69. "frames": [{
  70. "duration": 1.0,
  71. "texture": SubResource("AtlasTexture_gfl4j")
  72. }],
  73. "loop": true,
  74. "name": &"Rest",
  75. "speed": 5.0
  76. }]
  77. [sub_resource type="RectangleShape2D" id="RectangleShape2D_gfl4j"]
  78. size = Vector2(17, 18)
  79. [sub_resource type="RectangleShape2D" id="RectangleShape2D_fe1rr"]
  80. size = Vector2(16, 16)
  81. [node name="SwitchSpikeBlock" node_paths=PackedStringArray("hurtbox") instance=ExtResource("1_qn0kk")]
  82. hurtbox = NodePath("PlayerHurtBox/CollisionShape2D")
  83. [node name="Sprite" parent="." index="0"]
  84. sprite_frames = SubResource("SpriteFrames_cjipk")
  85. animation = &"Rest"
  86. autoplay = "Rest"
  87. [node name="ResourceSetter" parent="Sprite" index="0"]
  88. resource_json = ExtResource("3_gfl4j")
  89. [node name="Collision" parent="." index="1"]
  90. visible = true
  91. [node name="PlayerHurtBox" type="Area2D" parent="." index="3"]
  92. script = ExtResource("3_kmalu")
  93. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  94. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerHurtBox" index="0"]
  95. shape = SubResource("RectangleShape2D_gfl4j")
  96. disabled = true
  97. [node name="StaticBody2D" type="StaticBody2D" parent="." index="4"]
  98. [node name="StaticBody2D2" type="StaticBody2D" parent="." index="5"]
  99. collision_layer = 6
  100. collision_mask = 0
  101. [node name="Collision" type="CollisionShape2D" parent="StaticBody2D2" index="0"]
  102. shape = SubResource("RectangleShape2D_fe1rr")
  103. [connection signal="player_entered" from="PlayerHurtBox" to="." method="damage_player"]