Bumper.tscn 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. [gd_scene load_steps=15 format=3 uid="uid://bh0c141mlkiff"]
  2. [ext_resource type="Texture2D" uid="uid://dleohmr2yvsea" path="res://Assets/Sprites/Blocks/Bumper.png" id="1_7osxe"]
  3. [ext_resource type="Script" uid="uid://biu4x75tbkfk3" path="res://Scripts/Classes/Entities/Objects/Bumper.gd" id="1_yguea"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_yguea"]
  5. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_cgc3p"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_cgc3p"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/Bumper.json" id="5_ix70v"]
  8. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="7_tbo6k"]
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_ix70v"]
  10. atlas = ExtResource("1_7osxe")
  11. region = Rect2(0, 0, 48, 48)
  12. [sub_resource type="SpriteFrames" id="SpriteFrames_tbo6k"]
  13. animations = [{
  14. "frames": [{
  15. "duration": 1.0,
  16. "texture": SubResource("AtlasTexture_ix70v")
  17. }],
  18. "loop": true,
  19. "name": &"Idle",
  20. "speed": 5.0
  21. }]
  22. [sub_resource type="CircleShape2D" id="CircleShape2D_tbo6k"]
  23. radius = 24.0
  24. [sub_resource type="Animation" id="Animation_7osxe"]
  25. resource_name = "Bounce"
  26. length = 0.2
  27. tracks/0/type = "value"
  28. tracks/0/imported = false
  29. tracks/0/enabled = true
  30. tracks/0/path = NodePath("Sprite:scale")
  31. tracks/0/interp = 2
  32. tracks/0/loop_wrap = true
  33. tracks/0/keys = {
  34. "times": PackedFloat32Array(0, 0.033333335, 0.1, 0.16666667),
  35. "transitions": PackedFloat32Array(1, 1, 1, 1),
  36. "update": 0,
  37. "values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1.2, 1.2), Vector2(1, 1)]
  38. }
  39. [sub_resource type="Animation" id="Animation_yguea"]
  40. length = 0.001
  41. tracks/0/type = "value"
  42. tracks/0/imported = false
  43. tracks/0/enabled = true
  44. tracks/0/path = NodePath("Sprite:scale")
  45. tracks/0/interp = 1
  46. tracks/0/loop_wrap = true
  47. tracks/0/keys = {
  48. "times": PackedFloat32Array(0),
  49. "transitions": PackedFloat32Array(1),
  50. "update": 0,
  51. "values": [Vector2(1, 1)]
  52. }
  53. [sub_resource type="AnimationLibrary" id="AnimationLibrary_cgc3p"]
  54. _data = {
  55. &"Bounce": SubResource("Animation_7osxe"),
  56. &"RESET": SubResource("Animation_yguea")
  57. }
  58. [sub_resource type="RectangleShape2D" id="RectangleShape2D_tbo6k"]
  59. [node name="Bumper" type="AnimatableBody2D"]
  60. sync_to_physics = false
  61. script = ExtResource("1_yguea")
  62. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  63. sprite_frames = SubResource("SpriteFrames_tbo6k")
  64. animation = &"Idle"
  65. autoplay = "Idle"
  66. script = ExtResource("2_yguea")
  67. do_offset = false
  68. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  69. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  70. script = ExtResource("4_cgc3p")
  71. node_to_affect = NodePath("..")
  72. property_name = "sprite_frames"
  73. resource_json = ExtResource("5_ix70v")
  74. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  75. [node name="Hitbox" type="Area2D" parent="."]
  76. collision_layer = 255
  77. script = ExtResource("3_cgc3p")
  78. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  79. [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
  80. shape = SubResource("CircleShape2D_tbo6k")
  81. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  82. libraries = {
  83. &"": SubResource("AnimationLibrary_cgc3p")
  84. }
  85. autoplay = "RESET"
  86. [node name="TrackJoint" type="Node" parent="."]
  87. script = ExtResource("7_tbo6k")
  88. offset = Vector2(0, 0)
  89. disable_physics = false
  90. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  91. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  92. shape = SubResource("RectangleShape2D_tbo6k")
  93. [connection signal="player_entered" from="Hitbox" to="." method="bounce_player"]