RockyWrench.tscn 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. [gd_scene load_steps=34 format=3 uid="uid://c3m38c2skawpj"]
  2. [ext_resource type="Script" uid="uid://bfsh8bhcmknkh" path="res://Scripts/Classes/Entities/Enemies/RockyWrench.gd" id="1_pl7bt"]
  3. [ext_resource type="Texture2D" uid="uid://bfora2lrmtyj4" path="res://Assets/Sprites/Enemies/RockyWrench.png" id="2_8y80u"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_4h1b4"]
  5. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_wom81"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/RockyWrench.json" id="4_pl7bt"]
  7. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="5_4h1b4"]
  8. [ext_resource type="Script" uid="uid://bx6r8sjar6cwr" path="res://Scripts/Classes/Components/BasicStaticMovement.gd" id="5_8y80u"]
  9. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="7_pl7bt"]
  10. [ext_resource type="Texture2D" uid="uid://cop8x5m20cqal" path="res://Assets/Sprites/Items/WrenchProjectile.png" id="7_w66sd"]
  11. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="8_nqvoc"]
  12. [ext_resource type="JSON" path="res://Assets/Sprites/Items/WrenchProjectile.json" id="9_kxgad"]
  13. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="9_nxn7i"]
  14. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="10_w66sd"]
  15. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="13_h21ug"]
  16. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="14_el25t"]
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_nqvoc"]
  18. atlas = ExtResource("2_8y80u")
  19. region = Rect2(16, 0, 16, 32)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_3dqyr"]
  21. atlas = ExtResource("2_8y80u")
  22. region = Rect2(48, 0, 16, 32)
  23. [sub_resource type="AtlasTexture" id="AtlasTexture_nxn7i"]
  24. atlas = ExtResource("2_8y80u")
  25. region = Rect2(64, 0, 16, 32)
  26. [sub_resource type="AtlasTexture" id="AtlasTexture_w66sd"]
  27. atlas = ExtResource("2_8y80u")
  28. region = Rect2(0, 0, 16, 32)
  29. [sub_resource type="AtlasTexture" id="AtlasTexture_wom81"]
  30. atlas = ExtResource("2_8y80u")
  31. region = Rect2(32, 0, 16, 32)
  32. [sub_resource type="SpriteFrames" id="SpriteFrames_h21ug"]
  33. animations = [{
  34. "frames": [{
  35. "duration": 1.0,
  36. "texture": SubResource("AtlasTexture_nqvoc")
  37. }],
  38. "loop": true,
  39. "name": &"Aim",
  40. "speed": 5.0
  41. }, {
  42. "frames": [{
  43. "duration": 1.0,
  44. "texture": SubResource("AtlasTexture_3dqyr")
  45. }, {
  46. "duration": 1.0,
  47. "texture": SubResource("AtlasTexture_nxn7i")
  48. }],
  49. "loop": true,
  50. "name": &"Die",
  51. "speed": 10.0
  52. }, {
  53. "frames": [{
  54. "duration": 1.0,
  55. "texture": SubResource("AtlasTexture_w66sd")
  56. }],
  57. "loop": true,
  58. "name": &"Idle",
  59. "speed": 5.0
  60. }, {
  61. "frames": [{
  62. "duration": 1.0,
  63. "texture": SubResource("AtlasTexture_wom81")
  64. }],
  65. "loop": false,
  66. "name": &"Throw",
  67. "speed": 15.0
  68. }]
  69. [sub_resource type="RectangleShape2D" id="RectangleShape2D_pl7bt"]
  70. size = Vector2(14, 21)
  71. [sub_resource type="RectangleShape2D" id="RectangleShape2D_nqvoc"]
  72. size = Vector2(11, 13)
  73. [sub_resource type="AtlasTexture" id="AtlasTexture_bn4i0"]
  74. atlas = ExtResource("7_w66sd")
  75. region = Rect2(32, 0, 16, 16)
  76. [sub_resource type="AtlasTexture" id="AtlasTexture_ytcl6"]
  77. atlas = ExtResource("7_w66sd")
  78. region = Rect2(0, 0, 16, 16)
  79. [sub_resource type="AtlasTexture" id="AtlasTexture_tf2mk"]
  80. atlas = ExtResource("7_w66sd")
  81. region = Rect2(16, 0, 16, 16)
  82. [sub_resource type="AtlasTexture" id="AtlasTexture_nfd5u"]
  83. atlas = ExtResource("7_w66sd")
  84. region = Rect2(48, 0, 16, 16)
  85. [sub_resource type="SpriteFrames" id="SpriteFrames_el25t"]
  86. animations = [{
  87. "frames": [{
  88. "duration": 1.0,
  89. "texture": SubResource("AtlasTexture_bn4i0")
  90. }],
  91. "loop": true,
  92. "name": &"Idle",
  93. "speed": 5.0
  94. }, {
  95. "frames": [{
  96. "duration": 1.0,
  97. "texture": SubResource("AtlasTexture_ytcl6")
  98. }, {
  99. "duration": 1.0,
  100. "texture": SubResource("AtlasTexture_tf2mk")
  101. }, {
  102. "duration": 1.0,
  103. "texture": SubResource("AtlasTexture_nfd5u")
  104. }],
  105. "loop": true,
  106. "name": &"Spin",
  107. "speed": 15.0
  108. }]
  109. [sub_resource type="Animation" id="Animation_nqvoc"]
  110. resource_name = "PeekOut"
  111. length = 3.0
  112. tracks/0/type = "value"
  113. tracks/0/imported = false
  114. tracks/0/enabled = true
  115. tracks/0/path = NodePath("Sprite:position")
  116. tracks/0/interp = 1
  117. tracks/0/loop_wrap = true
  118. tracks/0/keys = {
  119. "times": PackedFloat32Array(0, 0.5, 2, 2.25),
  120. "transitions": PackedFloat32Array(1, 1, 1, 1),
  121. "update": 0,
  122. "values": [Vector2(0, 12), Vector2(0, 9), Vector2(0, 9), Vector2(0, 12)]
  123. }
  124. tracks/1/type = "value"
  125. tracks/1/imported = false
  126. tracks/1/enabled = true
  127. tracks/1/path = NodePath("Sprite/Wrench:visible")
  128. tracks/1/interp = 1
  129. tracks/1/loop_wrap = true
  130. tracks/1/keys = {
  131. "times": PackedFloat32Array(0),
  132. "transitions": PackedFloat32Array(1),
  133. "update": 1,
  134. "values": [false]
  135. }
  136. tracks/2/type = "value"
  137. tracks/2/imported = false
  138. tracks/2/enabled = true
  139. tracks/2/path = NodePath(".:can_stomp")
  140. tracks/2/interp = 1
  141. tracks/2/loop_wrap = true
  142. tracks/2/keys = {
  143. "times": PackedFloat32Array(0, 2.2666667),
  144. "transitions": PackedFloat32Array(1, 1),
  145. "update": 1,
  146. "values": [true, false]
  147. }
  148. [sub_resource type="Animation" id="Animation_4h1b4"]
  149. length = 0.001
  150. tracks/0/type = "value"
  151. tracks/0/imported = false
  152. tracks/0/enabled = true
  153. tracks/0/path = NodePath("Sprite:position")
  154. tracks/0/interp = 1
  155. tracks/0/loop_wrap = true
  156. tracks/0/keys = {
  157. "times": PackedFloat32Array(0),
  158. "transitions": PackedFloat32Array(1),
  159. "update": 0,
  160. "values": [Vector2(0, 12)]
  161. }
  162. tracks/1/type = "value"
  163. tracks/1/imported = false
  164. tracks/1/enabled = true
  165. tracks/1/path = NodePath("Sprite/Wrench:visible")
  166. tracks/1/interp = 1
  167. tracks/1/loop_wrap = true
  168. tracks/1/keys = {
  169. "times": PackedFloat32Array(0),
  170. "transitions": PackedFloat32Array(1),
  171. "update": 1,
  172. "values": [false]
  173. }
  174. tracks/2/type = "value"
  175. tracks/2/imported = false
  176. tracks/2/enabled = true
  177. tracks/2/path = NodePath(".:can_stomp")
  178. tracks/2/interp = 1
  179. tracks/2/loop_wrap = true
  180. tracks/2/keys = {
  181. "times": PackedFloat32Array(0),
  182. "transitions": PackedFloat32Array(1),
  183. "update": 1,
  184. "values": [false]
  185. }
  186. [sub_resource type="Animation" id="Animation_pl7bt"]
  187. resource_name = "Throw"
  188. length = 3.0
  189. tracks/0/type = "value"
  190. tracks/0/imported = false
  191. tracks/0/enabled = true
  192. tracks/0/path = NodePath("Sprite:position")
  193. tracks/0/interp = 1
  194. tracks/0/loop_wrap = true
  195. tracks/0/keys = {
  196. "times": PackedFloat32Array(0, 0.5, 2.0333333, 2.2666667),
  197. "transitions": PackedFloat32Array(1, 1, 1, 1),
  198. "update": 0,
  199. "values": [Vector2(0, 12), Vector2(0, 0), Vector2(0, 0), Vector2(0, 12)]
  200. }
  201. tracks/1/type = "value"
  202. tracks/1/imported = false
  203. tracks/1/enabled = true
  204. tracks/1/path = NodePath("Sprite/Wrench:visible")
  205. tracks/1/interp = 1
  206. tracks/1/loop_wrap = true
  207. tracks/1/keys = {
  208. "times": PackedFloat32Array(0, 1),
  209. "transitions": PackedFloat32Array(1, 1),
  210. "update": 1,
  211. "values": [true, false]
  212. }
  213. tracks/2/type = "method"
  214. tracks/2/imported = false
  215. tracks/2/enabled = true
  216. tracks/2/path = NodePath(".")
  217. tracks/2/interp = 1
  218. tracks/2/loop_wrap = true
  219. tracks/2/keys = {
  220. "times": PackedFloat32Array(1),
  221. "transitions": PackedFloat32Array(1),
  222. "values": [{
  223. "args": [],
  224. "method": &"throw_wrench"
  225. }]
  226. }
  227. tracks/3/type = "value"
  228. tracks/3/imported = false
  229. tracks/3/enabled = true
  230. tracks/3/path = NodePath(".:can_stomp")
  231. tracks/3/interp = 1
  232. tracks/3/loop_wrap = true
  233. tracks/3/keys = {
  234. "times": PackedFloat32Array(0, 3.7333336),
  235. "transitions": PackedFloat32Array(1, 1),
  236. "update": 1,
  237. "values": [true, false]
  238. }
  239. [sub_resource type="AnimationLibrary" id="AnimationLibrary_3dqyr"]
  240. _data = {
  241. &"PeekOut": SubResource("Animation_nqvoc"),
  242. &"RESET": SubResource("Animation_4h1b4"),
  243. &"Throw": SubResource("Animation_pl7bt")
  244. }
  245. [sub_resource type="RectangleShape2D" id="RectangleShape2D_h4tv3"]
  246. size = Vector2(14, 4)
  247. [node name="RockyWrench" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  248. z_index = -5
  249. collision_layer = 0
  250. collision_mask = 2
  251. script = ExtResource("1_pl7bt")
  252. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  253. score_note_adder = NodePath("ScoreNoteSpawner")
  254. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  255. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  256. position = Vector2(0, 12)
  257. scale = Vector2(-1, 1)
  258. sprite_frames = SubResource("SpriteFrames_h21ug")
  259. animation = &"Idle"
  260. frame_progress = 0.31085846
  261. flip_h = true
  262. script = ExtResource("3_wom81")
  263. do_offset = false
  264. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  265. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  266. script = ExtResource("3_4h1b4")
  267. node_to_affect = NodePath("..")
  268. property_name = "sprite_frames"
  269. resource_json = ExtResource("4_pl7bt")
  270. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  271. [node name="StompHitbox" type="Area2D" parent="Sprite"]
  272. position = Vector2(0, -11)
  273. script = ExtResource("5_4h1b4")
  274. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  275. [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/StompHitbox"]
  276. position = Vector2(0, 2.5)
  277. shape = SubResource("RectangleShape2D_pl7bt")
  278. [node name="EnemyPlayerDetection" type="Node" parent="Sprite/StompHitbox" node_paths=PackedStringArray("hitbox")]
  279. script = ExtResource("7_pl7bt")
  280. hitbox = NodePath("..")
  281. metadata/_custom_type_script = "uid://chj8hu207lrh"
  282. [node name="RemoteTransform2D" type="RemoteTransform2D" parent="Sprite"]
  283. position = Vector2(0, -14)
  284. remote_path = NodePath("../../AnimatableBody2D")
  285. [node name="EntityHitbox" type="Area2D" parent="Sprite"]
  286. position = Vector2(0, -12)
  287. [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/EntityHitbox"]
  288. position = Vector2(-0.5, 7.5)
  289. shape = SubResource("RectangleShape2D_nqvoc")
  290. [node name="EnemyPlayerDetection" type="Node" parent="Sprite/EntityHitbox" node_paths=PackedStringArray("hitbox")]
  291. script = ExtResource("7_pl7bt")
  292. hitbox = NodePath("..")
  293. metadata/_custom_type_script = "uid://chj8hu207lrh"
  294. [node name="Wrench" type="AnimatedSprite2D" parent="Sprite"]
  295. visible = false
  296. position = Vector2(-3, -14)
  297. sprite_frames = SubResource("SpriteFrames_el25t")
  298. animation = &"Idle"
  299. autoplay = "Idle"
  300. script = ExtResource("3_wom81")
  301. do_offset = false
  302. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  303. [node name="ResourceSetterNew" type="Node" parent="Sprite/Wrench" node_paths=PackedStringArray("node_to_affect")]
  304. script = ExtResource("3_4h1b4")
  305. node_to_affect = NodePath("..")
  306. property_name = "sprite_frames"
  307. resource_json = ExtResource("9_kxgad")
  308. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  309. [node name="BasicStaticMovement" type="Node" parent="."]
  310. script = ExtResource("5_8y80u")
  311. metadata/_custom_type_script = "uid://bx6r8sjar6cwr"
  312. [node name="Animations" type="AnimationPlayer" parent="."]
  313. libraries = {
  314. &"": SubResource("AnimationLibrary_3dqyr")
  315. }
  316. [node name="AnimatableBody2D" type="AnimatableBody2D" parent="."]
  317. position = Vector2(0, -2)
  318. rotation = 3.1415927
  319. scale = Vector2(1, -1)
  320. [node name="PlayerPlatform" type="CollisionShape2D" parent="AnimatableBody2D"]
  321. shape = SubResource("RectangleShape2D_h4tv3")
  322. one_way_collision = true
  323. [node name="Collision" type="CollisionShape2D" parent="."]
  324. position = Vector2(0, -2)
  325. shape = SubResource("RectangleShape2D_h4tv3")
  326. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  327. script = ExtResource("8_nqvoc")
  328. visuals = NodePath("../Sprite")
  329. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  330. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  331. script = ExtResource("9_nxn7i")
  332. hitbox = NodePath("../Sprite/EntityHitbox")
  333. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  334. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  335. script = ExtResource("10_w66sd")
  336. hitbox = NodePath("../Sprite/EntityHitbox")
  337. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  338. [node name="Timer" type="Timer" parent="."]
  339. one_shot = true
  340. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  341. rect = Rect2(-10, -10, 20, 29)
  342. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  343. script = ExtResource("13_h21ug")
  344. hitbox = NodePath("../Sprite/EntityHitbox")
  345. metadata/_custom_type_script = "uid://ba18grqjixded"
  346. [node name="ScoreNoteSpawner" type="Node" parent="."]
  347. script = ExtResource("14_el25t")
  348. add_score = true
  349. metadata/_custom_type_script = "uid://5octqlf4ohel"
  350. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  351. [connection signal="player_stomped_on" from="Sprite/StompHitbox/EnemyPlayerDetection" to="." method="on_player_stomped_on"]
  352. [connection signal="invincible_player_hit" from="Sprite/EntityHitbox/EnemyPlayerDetection" to="." method="die_from_object"]
  353. [connection signal="player_hit" from="Sprite/EntityHitbox/EnemyPlayerDetection" to="." method="damage_player"]
  354. [connection signal="gib_about_to_spawn" from="GibSpawner" to="Sprite/Wrench" method="hide"]
  355. [connection signal="gib_about_to_spawn" from="GibSpawner" to="Sprite" method="set_flip_v" binds= [true]]
  356. [connection signal="gib_about_to_spawn" from="GibSpawner" to="Sprite" method="play" binds= ["Dead"]]
  357. [connection signal="gib_about_to_spawn" from="GibSpawner" to="Sprite" method="set_offset" binds= [Vector2(0, -8)]]
  358. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  359. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [500]]
  360. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  361. [connection signal="timeout" from="Timer" to="." method="on_timeout"]
  362. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  363. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [500]]