enemy.tscn 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. [gd_scene load_steps=14 format=3 uid="uid://daqqtote00syu"]
  2. [ext_resource type="Script" path="res://enemy/enemy.gd" id="1_hjwkx"]
  3. [ext_resource type="Texture2D" uid="uid://crrmmbu8k46tl" path="res://enemy/enemy.png" id="2_org2d"]
  4. [ext_resource type="Texture2D" uid="uid://7sv64orewgmb" path="res://player/bullet.png" id="3_7unrb"]
  5. [ext_resource type="AudioStream" uid="uid://cfssio7r2t7wq" path="res://audio/sound_hit.wav" id="4_5rkwm"]
  6. [ext_resource type="AudioStream" uid="uid://bulmr2lpb7y4h" path="res://audio/sound_explode.wav" id="5_t2e2f"]
  7. [sub_resource type="PhysicsMaterial" id="1"]
  8. [sub_resource type="Animation" id="Animation_a7qal"]
  9. resource_name = "RESET"
  10. length = 0.01
  11. tracks/0/type = "value"
  12. tracks/0/imported = false
  13. tracks/0/enabled = true
  14. tracks/0/path = NodePath("Sprite2D:frame")
  15. tracks/0/interp = 1
  16. tracks/0/loop_wrap = true
  17. tracks/0/keys = {
  18. "times": PackedFloat32Array(0),
  19. "transitions": PackedFloat32Array(1),
  20. "update": 1,
  21. "values": [0]
  22. }
  23. tracks/1/type = "value"
  24. tracks/1/imported = false
  25. tracks/1/enabled = true
  26. tracks/1/path = NodePath("Sprite2D:self_modulate")
  27. tracks/1/interp = 1
  28. tracks/1/loop_wrap = true
  29. tracks/1/keys = {
  30. "times": PackedFloat32Array(0),
  31. "transitions": PackedFloat32Array(1),
  32. "update": 0,
  33. "values": [Color(1, 1, 1, 1)]
  34. }
  35. [sub_resource type="Animation" id="2"]
  36. length = 6.0
  37. step = 0.0
  38. tracks/0/type = "value"
  39. tracks/0/imported = false
  40. tracks/0/enabled = true
  41. tracks/0/path = NodePath("Sprite2D:frame")
  42. tracks/0/interp = 1
  43. tracks/0/loop_wrap = true
  44. tracks/0/keys = {
  45. "times": PackedFloat32Array(0),
  46. "transitions": PackedFloat32Array(1),
  47. "update": 0,
  48. "values": [4]
  49. }
  50. tracks/1/type = "value"
  51. tracks/1/imported = false
  52. tracks/1/enabled = true
  53. tracks/1/path = NodePath("Explosion:emitting")
  54. tracks/1/interp = 1
  55. tracks/1/loop_wrap = true
  56. tracks/1/keys = {
  57. "times": PackedFloat32Array(1),
  58. "transitions": PackedFloat32Array(1),
  59. "update": 1,
  60. "values": [true]
  61. }
  62. tracks/2/type = "method"
  63. tracks/2/imported = false
  64. tracks/2/enabled = true
  65. tracks/2/path = NodePath(".")
  66. tracks/2/interp = 1
  67. tracks/2/loop_wrap = true
  68. tracks/2/keys = {
  69. "times": PackedFloat32Array(1.04, 2),
  70. "transitions": PackedFloat32Array(1, 1),
  71. "values": [{
  72. "args": [],
  73. "method": &"_pre_explode"
  74. }, {
  75. "args": [],
  76. "method": &"_die"
  77. }]
  78. }
  79. tracks/3/type = "value"
  80. tracks/3/imported = false
  81. tracks/3/enabled = true
  82. tracks/3/path = NodePath("Sprite2D:self_modulate")
  83. tracks/3/interp = 1
  84. tracks/3/loop_wrap = true
  85. tracks/3/keys = {
  86. "times": PackedFloat32Array(0.5, 1.1),
  87. "transitions": PackedFloat32Array(1, 1),
  88. "update": 0,
  89. "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
  90. }
  91. [sub_resource type="Animation" id="3"]
  92. length = 6.75
  93. loop_mode = 1
  94. step = 0.25
  95. tracks/0/type = "value"
  96. tracks/0/imported = false
  97. tracks/0/enabled = true
  98. tracks/0/path = NodePath("Sprite2D:frame")
  99. tracks/0/interp = 1
  100. tracks/0/loop_wrap = true
  101. tracks/0/keys = {
  102. "times": PackedFloat32Array(0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75),
  103. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  104. "update": 1,
  105. "values": [5, 6, 5, 6, 5, 6, 7, 6, 7, 5]
  106. }
  107. [sub_resource type="Animation" id="4"]
  108. length = 1.25
  109. loop_mode = 1
  110. step = 0.25
  111. tracks/0/type = "value"
  112. tracks/0/imported = false
  113. tracks/0/enabled = true
  114. tracks/0/path = NodePath("Sprite2D:frame")
  115. tracks/0/interp = 1
  116. tracks/0/loop_wrap = true
  117. tracks/0/keys = {
  118. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75, 1, 1.25),
  119. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
  120. "update": 1,
  121. "values": [0, 1, 2, 3, 4, 0]
  122. }
  123. [sub_resource type="AnimationLibrary" id="AnimationLibrary_ay0tp"]
  124. _data = {
  125. "RESET": SubResource("Animation_a7qal"),
  126. "explode": SubResource("2"),
  127. "idle": SubResource("3"),
  128. "walk": SubResource("4")
  129. }
  130. [sub_resource type="CircleShape2D" id="5"]
  131. radius = 7.0
  132. [sub_resource type="Gradient" id="6"]
  133. offsets = PackedFloat32Array(0.5, 1)
  134. colors = PackedColorArray(1, 1, 1, 0.501961, 0, 0, 0, 0)
  135. [node name="Enemy" type="RigidBody2D"]
  136. physics_material_override = SubResource("1")
  137. max_contacts_reported = 4
  138. contact_monitor = true
  139. lock_rotation = true
  140. script = ExtResource("1_hjwkx")
  141. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  142. libraries = {
  143. "": SubResource("AnimationLibrary_ay0tp")
  144. }
  145. [node name="SoundExplode" type="AudioStreamPlayer2D" parent="."]
  146. stream = ExtResource("5_t2e2f")
  147. [node name="SoundHit" type="AudioStreamPlayer2D" parent="."]
  148. position = Vector2(0, -1)
  149. stream = ExtResource("4_5rkwm")
  150. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  151. rect = Rect2(-150, -100, 300, 200)
  152. [node name="Sprite2D" type="Sprite2D" parent="."]
  153. texture = ExtResource("2_org2d")
  154. hframes = 8
  155. [node name="Shape1" type="CollisionShape2D" parent="."]
  156. position = Vector2(-0.54036, -1.08072)
  157. shape = SubResource("5")
  158. [node name="Shape2" type="CollisionShape2D" parent="."]
  159. position = Vector2(3.24216, 1.62108)
  160. shape = SubResource("5")
  161. [node name="Shape3" type="CollisionShape2D" parent="."]
  162. position = Vector2(-6.2475, 1.76707)
  163. shape = SubResource("5")
  164. [node name="RaycastLeft" type="RayCast2D" parent="."]
  165. position = Vector2(-14, -4.672)
  166. [node name="RaycastRight" type="RayCast2D" parent="."]
  167. position = Vector2(11, -4.672)
  168. [node name="Explosion" type="CPUParticles2D" parent="."]
  169. modulate = Color(1, 1, 1, 0.685843)
  170. emitting = false
  171. amount = 32
  172. lifetime = 0.5
  173. one_shot = true
  174. speed_scale = 1.2
  175. explosiveness = 0.76
  176. texture = ExtResource("3_7unrb")
  177. emission_shape = 1
  178. emission_sphere_radius = 8.0
  179. spread = 180.0
  180. gravity = Vector2(0, 0)
  181. color_ramp = SubResource("6")