enemy.tscn 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. [gd_scene load_steps=13 format=2]
  2. [ext_resource path="res://enemy.gd" type="Script" id=1]
  3. [ext_resource path="res://enemy.png" type="Texture" id=2]
  4. [ext_resource path="res://bullet.png" type="Texture" id=3]
  5. [ext_resource path="res://sound_hit.wav" type="AudioStream" id=4]
  6. [ext_resource path="res://sound_explode.wav" type="AudioStream" id=5]
  7. [sub_resource type="Animation" id=1]
  8. resource_name = "explode"
  9. length = 5.0
  10. loop = false
  11. step = 0.0
  12. tracks/0/type = "value"
  13. tracks/0/path = NodePath("sprite:frame")
  14. tracks/0/interp = 1
  15. tracks/0/loop_wrap = true
  16. tracks/0/imported = false
  17. tracks/0/keys = {
  18. "times": PoolRealArray( 0 ),
  19. "transitions": PoolRealArray( 1 ),
  20. "update": 0,
  21. "values": [ 0 ]
  22. }
  23. tracks/1/type = "value"
  24. tracks/1/path = NodePath("sprite:rotation_degrees")
  25. tracks/1/interp = 1
  26. tracks/1/loop_wrap = true
  27. tracks/1/imported = false
  28. tracks/1/keys = {
  29. "times": PoolRealArray( 0, 3.2 ),
  30. "transitions": PoolRealArray( 0.5, 1 ),
  31. "update": 0,
  32. "values": [ 0.0, 180.0 ]
  33. }
  34. tracks/2/type = "value"
  35. tracks/2/path = NodePath("sprite:self_modulate")
  36. tracks/2/interp = 1
  37. tracks/2/loop_wrap = true
  38. tracks/2/imported = false
  39. tracks/2/keys = {
  40. "times": PoolRealArray( 2.6, 3.4 ),
  41. "transitions": PoolRealArray( 1, 1 ),
  42. "update": 0,
  43. "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
  44. }
  45. tracks/3/type = "value"
  46. tracks/3/path = NodePath("explosion:emitting")
  47. tracks/3/interp = 1
  48. tracks/3/loop_wrap = true
  49. tracks/3/imported = false
  50. tracks/3/keys = {
  51. "times": PoolRealArray( 0, 2.8 ),
  52. "transitions": PoolRealArray( 1, 1 ),
  53. "update": 1,
  54. "values": [ false, true ]
  55. }
  56. tracks/4/type = "value"
  57. tracks/4/path = NodePath("explosion:process_material:scale")
  58. tracks/4/interp = 1
  59. tracks/4/loop_wrap = true
  60. tracks/4/imported = false
  61. tracks/4/keys = {
  62. "times": PoolRealArray( 2.8, 3.4 ),
  63. "transitions": PoolRealArray( 1, 1 ),
  64. "update": 0,
  65. "values": [ 1.0, 4.0 ]
  66. }
  67. tracks/5/type = "value"
  68. tracks/5/path = NodePath("sound_hit:playing")
  69. tracks/5/interp = 1
  70. tracks/5/loop_wrap = true
  71. tracks/5/imported = false
  72. tracks/5/keys = {
  73. "times": PoolRealArray( 0.00999999 ),
  74. "transitions": PoolRealArray( 1 ),
  75. "update": 1,
  76. "values": [ true ]
  77. }
  78. tracks/6/type = "value"
  79. tracks/6/path = NodePath("sound_explode:playing")
  80. tracks/6/interp = 1
  81. tracks/6/loop_wrap = true
  82. tracks/6/imported = false
  83. tracks/6/keys = {
  84. "times": PoolRealArray( 2.9 ),
  85. "transitions": PoolRealArray( 1 ),
  86. "update": 1,
  87. "values": [ true ]
  88. }
  89. tracks/7/type = "method"
  90. tracks/7/path = NodePath(".")
  91. tracks/7/interp = 1
  92. tracks/7/loop_wrap = true
  93. tracks/7/imported = false
  94. tracks/7/keys = {
  95. "times": PoolRealArray( 4.2 ),
  96. "transitions": PoolRealArray( 1 ),
  97. "values": [ {
  98. "args": [ ],
  99. "method": "queue_free"
  100. } ]
  101. }
  102. [sub_resource type="Animation" id=2]
  103. length = 6.75
  104. loop = true
  105. step = 0.25
  106. tracks/0/type = "value"
  107. tracks/0/path = NodePath("sprite:frame")
  108. tracks/0/interp = 1
  109. tracks/0/loop_wrap = true
  110. tracks/0/imported = false
  111. tracks/0/keys = {
  112. "times": PoolRealArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ),
  113. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
  114. "update": 1,
  115. "values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ]
  116. }
  117. [sub_resource type="Animation" id=3]
  118. resource_name = "walk"
  119. length = 1.25
  120. loop = true
  121. step = 0.25
  122. tracks/0/type = "value"
  123. tracks/0/path = NodePath("sprite:frame")
  124. tracks/0/interp = 1
  125. tracks/0/loop_wrap = true
  126. tracks/0/imported = false
  127. tracks/0/keys = {
  128. "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
  129. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
  130. "update": 1,
  131. "values": [ 0, 1, 2, 3, 4, 0 ]
  132. }
  133. [sub_resource type="CanvasItemMaterial" id=4]
  134. render_priority = 0
  135. blend_mode = 0
  136. light_mode = 0
  137. [sub_resource type="CapsuleShape2D" id=5]
  138. custom_solver_bias = 0.0
  139. radius = 13.4556
  140. height = 14.2002
  141. [sub_resource type="CanvasItemMaterial" id=6]
  142. render_priority = 0
  143. blend_mode = 1
  144. light_mode = 0
  145. [sub_resource type="ParticlesMaterial" id=7]
  146. render_priority = 0
  147. trail_divisor = 1
  148. emission_shape = 0
  149. flag_align_y = false
  150. flag_rotate_y = false
  151. flag_disable_z = true
  152. spread = 180.0
  153. flatness = 0.0
  154. gravity = Vector3( 0, 98, 0 )
  155. initial_velocity = 90.0
  156. initial_velocity_random = 0.0
  157. angular_velocity = 2.0
  158. angular_velocity_random = 1.0
  159. orbit_velocity = 0.0
  160. orbit_velocity_random = 0.0
  161. linear_accel = 0.0
  162. linear_accel_random = 0.0
  163. radial_accel = 0.0
  164. radial_accel_random = 0.0
  165. tangential_accel = 0.0
  166. tangential_accel_random = 0.0
  167. damping = 0.0
  168. damping_random = 0.0
  169. angle = 0.0
  170. angle_random = 0.0
  171. scale = 1.0
  172. scale_random = 0.0
  173. color = Color( 0.929688, 0.488931, 0.0617371, 1 )
  174. hue_variation = 0.0
  175. hue_variation_random = 0.0
  176. anim_speed = 1.0
  177. anim_speed_random = 0.0
  178. anim_offset = 0.0
  179. anim_offset_random = 0.0
  180. anim_loop = false
  181. _sections_unfolded = [ "Angle", "Angular Velocity", "Animation", "Color", "Damping", "Emission Shape", "Flags", "Gravity", "Hue Variation", "Initial Velocity", "Linear Accel", "Orbit Velocity", "Radial Accel", "Scale", "Spread", "Tangential Accel" ]
  182. [node name="enemy" type="KinematicBody2D"]
  183. input_pickable = false
  184. collision_layer = 1
  185. collision_mask = 1
  186. collision/safe_margin = 0.08
  187. script = ExtResource( 1 )
  188. _sections_unfolded = [ "Collision", "Pickable", "Transform", "Z", "collision" ]
  189. [node name="enabler" type="VisibilityEnabler2D" parent="."]
  190. position = Vector2( 16.2569, 11.0034 )
  191. scale = Vector2( 23.5056, 10.8629 )
  192. rect = Rect2( -10, -10, 20, 20 )
  193. pause_animations = true
  194. freeze_bodies = true
  195. pause_particles = false
  196. pause_animated_sprites = true
  197. process_parent = false
  198. physics_process_parent = false
  199. [node name="anim" type="AnimationPlayer" parent="."]
  200. playback_process_mode = 1
  201. playback_default_blend_time = 0.0
  202. root_node = NodePath("..")
  203. anims/explode = SubResource( 1 )
  204. anims/idle = SubResource( 2 )
  205. anims/walk = SubResource( 3 )
  206. playback/active = true
  207. playback/speed = 3.0
  208. blend_times = [ ]
  209. autoplay = ""
  210. _sections_unfolded = [ "Playback Options", "playback" ]
  211. [node name="sprite" type="Sprite" parent="."]
  212. material = SubResource( 4 )
  213. texture = ExtResource( 2 )
  214. flip_h = true
  215. hframes = 8
  216. _sections_unfolded = [ "Animation", "Material", "Region", "Transform", "Visibility" ]
  217. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  218. position = Vector2( -0.00525069, -0.727495 )
  219. rotation = -1.5708
  220. shape = SubResource( 5 )
  221. [node name="detect_floor_left" type="RayCast2D" parent="."]
  222. position = Vector2( -33.2868, -9.34363 )
  223. enabled = true
  224. exclude_parent = true
  225. cast_to = Vector2( 0, 45 )
  226. collision_mask = 1
  227. type_mask = 15
  228. [node name="detect_wall_left" type="RayCast2D" parent="."]
  229. position = Vector2( -12.1361, -0.739977 )
  230. rotation = 1.5708
  231. enabled = true
  232. exclude_parent = true
  233. cast_to = Vector2( 0, 20 )
  234. collision_mask = 1
  235. type_mask = 15
  236. [node name="detect_wall_right" type="RayCast2D" parent="."]
  237. position = Vector2( 3.2788, -0.381488 )
  238. rotation = -1.5708
  239. enabled = true
  240. exclude_parent = true
  241. cast_to = Vector2( 0, 20 )
  242. collision_mask = 1
  243. type_mask = 15
  244. [node name="detect_floor_right" type="RayCast2D" parent="."]
  245. position = Vector2( 29.1987, -9.34363 )
  246. enabled = true
  247. exclude_parent = true
  248. cast_to = Vector2( 0, 45 )
  249. collision_mask = 1
  250. type_mask = 15
  251. [node name="explosion" type="Particles2D" parent="."]
  252. self_modulate = Color( 1, 1, 1, 0.12 )
  253. material = SubResource( 6 )
  254. emitting = false
  255. amount = 32
  256. lifetime = 0.5
  257. one_shot = true
  258. preprocess = 0.0
  259. speed_scale = 1.2
  260. explosiveness = 0.1
  261. randomness = 0.0
  262. fixed_fps = 0
  263. fract_delta = true
  264. visibility_rect = Rect2( -100, -100, 200, 200 )
  265. local_coords = true
  266. draw_order = 215832976
  267. process_material = SubResource( 7 )
  268. texture = ExtResource( 3 )
  269. normal_map = null
  270. h_frames = 1
  271. v_frames = 1
  272. _sections_unfolded = [ "Drawing", "Material", "Process Material", "Textures", "Time", "Visibility" ]
  273. [node name="sound_hit" type="AudioStreamPlayer2D" parent="."]
  274. stream = ExtResource( 4 )
  275. volume_db = 0.0
  276. autoplay = false
  277. max_distance = 2000.0
  278. attenuation = 1.0
  279. bus = "Master"
  280. area_mask = 1
  281. [node name="sound_explode" type="AudioStreamPlayer2D" parent="."]
  282. stream = ExtResource( 5 )
  283. volume_db = 0.0
  284. autoplay = false
  285. max_distance = 2000.0
  286. attenuation = 1.0
  287. bus = "Master"
  288. area_mask = 1