Enemy.tscn 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. [gd_scene load_steps=14 format=2]
  2. [ext_resource path="res://enemy/enemy.gd" type="Script" id=1]
  3. [ext_resource path="res://enemy/enemy.png" type="Texture" id=2]
  4. [ext_resource path="res://player/bullet.png" type="Texture" id=3]
  5. [ext_resource path="res://audio/sound_hit.wav" type="AudioStream" id=4]
  6. [ext_resource path="res://audio/sound_explode.wav" type="AudioStream" id=5]
  7. [sub_resource type="PhysicsMaterial" id=1]
  8. [sub_resource type="Animation" id=2]
  9. length = 6.0
  10. step = 0.0
  11. tracks/0/type = "value"
  12. tracks/0/path = NodePath("Sprite:frame")
  13. tracks/0/interp = 1
  14. tracks/0/loop_wrap = true
  15. tracks/0/imported = false
  16. tracks/0/enabled = true
  17. tracks/0/keys = {
  18. "times": PoolRealArray( 0 ),
  19. "transitions": PoolRealArray( 1 ),
  20. "update": 0,
  21. "values": [ 4 ]
  22. }
  23. tracks/1/type = "value"
  24. tracks/1/path = NodePath("Explosion:emitting")
  25. tracks/1/interp = 1
  26. tracks/1/loop_wrap = true
  27. tracks/1/imported = false
  28. tracks/1/enabled = true
  29. tracks/1/keys = {
  30. "times": PoolRealArray( 1 ),
  31. "transitions": PoolRealArray( 1 ),
  32. "update": 1,
  33. "values": [ true ]
  34. }
  35. tracks/2/type = "method"
  36. tracks/2/path = NodePath(".")
  37. tracks/2/interp = 1
  38. tracks/2/loop_wrap = true
  39. tracks/2/imported = false
  40. tracks/2/enabled = true
  41. tracks/2/keys = {
  42. "times": PoolRealArray( 0.8, 2 ),
  43. "transitions": PoolRealArray( 1, 1 ),
  44. "values": [ {
  45. "args": [ ],
  46. "method": "_pre_explode"
  47. }, {
  48. "args": [ ],
  49. "method": "_die"
  50. } ]
  51. }
  52. tracks/3/type = "value"
  53. tracks/3/path = NodePath("Sprite:self_modulate")
  54. tracks/3/interp = 1
  55. tracks/3/loop_wrap = true
  56. tracks/3/imported = false
  57. tracks/3/enabled = true
  58. tracks/3/keys = {
  59. "times": PoolRealArray( 0.5, 1.1 ),
  60. "transitions": PoolRealArray( 1, 1 ),
  61. "update": 0,
  62. "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
  63. }
  64. [sub_resource type="Animation" id=3]
  65. length = 6.75
  66. loop = true
  67. step = 0.25
  68. tracks/0/type = "value"
  69. tracks/0/path = NodePath("Sprite:frame")
  70. tracks/0/interp = 1
  71. tracks/0/loop_wrap = true
  72. tracks/0/imported = false
  73. tracks/0/enabled = true
  74. tracks/0/keys = {
  75. "times": PoolRealArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ),
  76. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
  77. "update": 1,
  78. "values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ]
  79. }
  80. [sub_resource type="Animation" id=4]
  81. length = 1.25
  82. loop = true
  83. step = 0.25
  84. tracks/0/type = "value"
  85. tracks/0/path = NodePath("Sprite:frame")
  86. tracks/0/interp = 1
  87. tracks/0/loop_wrap = true
  88. tracks/0/imported = false
  89. tracks/0/enabled = true
  90. tracks/0/keys = {
  91. "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
  92. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
  93. "update": 1,
  94. "values": [ 0, 1, 2, 3, 4, 0 ]
  95. }
  96. [sub_resource type="CircleShape2D" id=5]
  97. radius = 7.0
  98. [sub_resource type="Gradient" id=6]
  99. offsets = PoolRealArray( 0.5, 1 )
  100. colors = PoolColorArray( 1, 1, 1, 0.501961, 0, 0, 0, 0 )
  101. [sub_resource type="GradientTexture" id=7]
  102. gradient = SubResource( 6 )
  103. [sub_resource type="ParticlesMaterial" id=8]
  104. emission_shape = 1
  105. emission_sphere_radius = 8.0
  106. flag_disable_z = true
  107. spread = 180.0
  108. gravity = Vector3( 0, 0, 0 )
  109. initial_velocity = 120.0
  110. initial_velocity_random = 0.5
  111. orbit_velocity = 0.0
  112. orbit_velocity_random = 0.0
  113. angle_random = 1.0
  114. scale_random = 1.0
  115. color_ramp = SubResource( 7 )
  116. [node name="Enemy" type="RigidBody2D"]
  117. mode = 2
  118. physics_material_override = SubResource( 1 )
  119. contacts_reported = 4
  120. script = ExtResource( 1 )
  121. [node name="Enabler" type="VisibilityEnabler2D" parent="."]
  122. position = Vector2( 8.12845, 5.5017 )
  123. scale = Vector2( 11.7528, 5.43145 )
  124. pause_particles = false
  125. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  126. anims/explode = SubResource( 2 )
  127. anims/idle = SubResource( 3 )
  128. anims/walk = SubResource( 4 )
  129. [node name="Sprite" type="Sprite" parent="."]
  130. texture = ExtResource( 2 )
  131. hframes = 8
  132. frame = 4
  133. [node name="Shape1" type="CollisionShape2D" parent="."]
  134. position = Vector2( -0.54036, -1.08072 )
  135. shape = SubResource( 5 )
  136. [node name="Shape2" type="CollisionShape2D" parent="."]
  137. position = Vector2( 3.24216, 1.62108 )
  138. shape = SubResource( 5 )
  139. [node name="Shape3" type="CollisionShape2D" parent="."]
  140. position = Vector2( -6.2475, 1.76707 )
  141. shape = SubResource( 5 )
  142. [node name="RaycastLeft" type="RayCast2D" parent="."]
  143. position = Vector2( -14, -4.672 )
  144. enabled = true
  145. cast_to = Vector2( 0, 22.5 )
  146. [node name="RaycastRight" type="RayCast2D" parent="."]
  147. position = Vector2( 11, -4.672 )
  148. enabled = true
  149. cast_to = Vector2( 0, 22.5 )
  150. [node name="Explosion" type="Particles2D" parent="."]
  151. modulate = Color( 1, 1, 1, 0.685843 )
  152. emitting = false
  153. amount = 32
  154. lifetime = 0.5
  155. one_shot = true
  156. speed_scale = 1.2
  157. explosiveness = 0.76
  158. process_material = SubResource( 8 )
  159. texture = ExtResource( 3 )
  160. [node name="SoundHit" type="AudioStreamPlayer2D" parent="."]
  161. stream = ExtResource( 4 )
  162. [node name="SoundExplode" type="AudioStreamPlayer2D" parent="."]
  163. stream = ExtResource( 5 )