bullet.tscn 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. [gd_scene load_steps=13 format=3 uid="uid://df7ddsoclivwe"]
  2. [ext_resource type="Texture2D" uid="uid://coj0d33vyyqx1" path="res://player/bullet.webp" id="1"]
  3. [ext_resource type="Script" path="res://player/bullet.gd" id="2"]
  4. [sub_resource type="CanvasItemMaterial" id="1"]
  5. [sub_resource type="CanvasItemMaterial" id="2"]
  6. blend_mode = 1
  7. [sub_resource type="CanvasItemMaterial" id="3"]
  8. [sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_ltbhv"]
  9. blend_mode = 1
  10. [sub_resource type="Gradient" id="Gradient_o13ul"]
  11. interpolation_mode = 2
  12. colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
  13. [sub_resource type="GradientTexture2D" id="GradientTexture2D_0sj74"]
  14. gradient = SubResource("Gradient_o13ul")
  15. fill = 1
  16. fill_from = Vector2(0.5, 0.5)
  17. fill_to = Vector2(0.5, 0.01)
  18. [sub_resource type="CircleShape2D" id="4"]
  19. radius = 8.0
  20. [sub_resource type="Animation" id="Animation_v7668"]
  21. length = 0.001
  22. tracks/0/type = "value"
  23. tracks/0/imported = false
  24. tracks/0/enabled = true
  25. tracks/0/path = NodePath("Sprite2D:modulate")
  26. tracks/0/interp = 1
  27. tracks/0/loop_wrap = true
  28. tracks/0/keys = {
  29. "times": PackedFloat32Array(0),
  30. "transitions": PackedFloat32Array(1),
  31. "update": 0,
  32. "values": [Color(1, 1, 1, 1)]
  33. }
  34. [sub_resource type="Animation" id="5"]
  35. resource_name = "destroy"
  36. length = 0.3
  37. tracks/0/type = "method"
  38. tracks/0/imported = false
  39. tracks/0/enabled = true
  40. tracks/0/path = NodePath(".")
  41. tracks/0/interp = 1
  42. tracks/0/loop_wrap = true
  43. tracks/0/keys = {
  44. "times": PackedFloat32Array(0.3),
  45. "transitions": PackedFloat32Array(1),
  46. "values": [{
  47. "args": [],
  48. "method": &"queue_free"
  49. }]
  50. }
  51. tracks/1/type = "value"
  52. tracks/1/imported = false
  53. tracks/1/enabled = true
  54. tracks/1/path = NodePath("CPUParticles2D:self_modulate")
  55. tracks/1/interp = 1
  56. tracks/1/loop_wrap = true
  57. tracks/1/keys = {
  58. "times": PackedFloat32Array(0, 0.3),
  59. "transitions": PackedFloat32Array(1, 1),
  60. "update": 0,
  61. "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
  62. }
  63. tracks/2/type = "value"
  64. tracks/2/imported = false
  65. tracks/2/enabled = true
  66. tracks/2/path = NodePath("Sprite2D:modulate")
  67. tracks/2/interp = 1
  68. tracks/2/loop_wrap = true
  69. tracks/2/keys = {
  70. "times": PackedFloat32Array(0, 0.3),
  71. "transitions": PackedFloat32Array(1, 1),
  72. "update": 0,
  73. "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
  74. }
  75. [sub_resource type="AnimationLibrary" id="AnimationLibrary_iv8gr"]
  76. _data = {
  77. "RESET": SubResource("Animation_v7668"),
  78. "destroy": SubResource("5")
  79. }
  80. [node name="Bullet" type="RigidBody2D"]
  81. z_index = 5
  82. material = SubResource("1")
  83. collision_layer = 0
  84. collision_mask = 26
  85. mass = 0.0283333
  86. gravity_scale = 0.1
  87. continuous_cd = 2
  88. max_contacts_reported = 1
  89. contact_monitor = true
  90. script = ExtResource("2")
  91. [node name="CPUParticles2D" type="CPUParticles2D" parent="."]
  92. self_modulate = Color(1, 1, 1, 0)
  93. material = SubResource("2")
  94. emitting = false
  95. lifetime = 0.1
  96. speed_scale = 3.0
  97. texture = ExtResource("1")
  98. spread = 0.0
  99. gravity = Vector2(0, 0)
  100. color = Color(1, 1, 1, 0.705882)
  101. [node name="Sprite2D" type="Sprite2D" parent="."]
  102. material = SubResource("3")
  103. texture = ExtResource("1")
  104. [node name="Glow" type="Sprite2D" parent="Sprite2D"]
  105. modulate = Color(0.501961, 1, 1, 0.25098)
  106. material = SubResource("CanvasItemMaterial_ltbhv")
  107. scale = Vector2(0.667, 0.667)
  108. texture = SubResource("GradientTexture2D_0sj74")
  109. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  110. shape = SubResource("4")
  111. [node name="Timer" type="Timer" parent="."]
  112. one_shot = true
  113. autostart = true
  114. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  115. libraries = {
  116. "": SubResource("AnimationLibrary_iv8gr")
  117. }
  118. [connection signal="body_entered" from="." to="." method="_on_body_entered"]
  119. [connection signal="timeout" from="Timer" to="." method="destroy"]