player.tscn 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. [gd_scene load_steps=18 format=3 uid="uid://vh7pmputa7r3"]
  2. [ext_resource type="Script" path="res://player/player.gd" id="3"]
  3. [ext_resource type="AudioStream" uid="uid://sjod173axgwf" path="res://player/jump.wav" id="5"]
  4. [ext_resource type="AudioStream" uid="uid://b01brytl75mwa" path="res://player/shoot.wav" id="6"]
  5. [ext_resource type="Script" path="res://player/gun.gd" id="8"]
  6. [ext_resource type="Texture2D" uid="uid://cc7o7t0ramd6y" path="res://player/robot.webp" id="9"]
  7. [sub_resource type="Animation" id="1"]
  8. resource_name = "crouch"
  9. length = 0.01
  10. step = 0.25
  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": [42]
  22. }
  23. [sub_resource type="Animation" id="2"]
  24. resource_name = "falling"
  25. length = 0.01
  26. step = 0.25
  27. tracks/0/type = "value"
  28. tracks/0/imported = false
  29. tracks/0/enabled = true
  30. tracks/0/path = NodePath("Sprite2D:frame")
  31. tracks/0/interp = 1
  32. tracks/0/loop_wrap = true
  33. tracks/0/keys = {
  34. "times": PackedFloat32Array(0),
  35. "transitions": PackedFloat32Array(1),
  36. "update": 1,
  37. "values": [48]
  38. }
  39. [sub_resource type="Animation" id="3"]
  40. resource_name = "falling_weapon"
  41. length = 0.5
  42. step = 0.25
  43. tracks/0/type = "value"
  44. tracks/0/imported = false
  45. tracks/0/enabled = true
  46. tracks/0/path = NodePath("Sprite2D:frame")
  47. tracks/0/interp = 1
  48. tracks/0/loop_wrap = true
  49. tracks/0/keys = {
  50. "times": PackedFloat32Array(0),
  51. "transitions": PackedFloat32Array(1),
  52. "update": 1,
  53. "values": [26]
  54. }
  55. [sub_resource type="Animation" id="4"]
  56. loop_mode = 1
  57. step = 0.25
  58. tracks/0/type = "value"
  59. tracks/0/imported = false
  60. tracks/0/enabled = true
  61. tracks/0/path = NodePath("Sprite2D:frame")
  62. tracks/0/interp = 1
  63. tracks/0/loop_wrap = true
  64. tracks/0/keys = {
  65. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75),
  66. "transitions": PackedFloat32Array(1, 1, 1, 1),
  67. "update": 1,
  68. "values": [30, 31, 32, 33]
  69. }
  70. [sub_resource type="Animation" id="5"]
  71. step = 0.25
  72. tracks/0/type = "value"
  73. tracks/0/imported = false
  74. tracks/0/enabled = true
  75. tracks/0/path = NodePath("Sprite2D:frame")
  76. tracks/0/interp = 1
  77. tracks/0/loop_wrap = true
  78. tracks/0/keys = {
  79. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75),
  80. "transitions": PackedFloat32Array(1, 1, 1, 1),
  81. "update": 1,
  82. "values": [34, 35, 36, 37]
  83. }
  84. [sub_resource type="Animation" id="6"]
  85. length = 0.5
  86. step = 0.25
  87. tracks/0/type = "value"
  88. tracks/0/imported = false
  89. tracks/0/enabled = true
  90. tracks/0/path = NodePath("Sprite2D:frame")
  91. tracks/0/interp = 1
  92. tracks/0/loop_wrap = true
  93. tracks/0/keys = {
  94. "times": PackedFloat32Array(0),
  95. "transitions": PackedFloat32Array(1),
  96. "update": 1,
  97. "values": [45]
  98. }
  99. [sub_resource type="Animation" id="7"]
  100. length = 0.5
  101. step = 0.25
  102. tracks/0/type = "value"
  103. tracks/0/imported = false
  104. tracks/0/enabled = true
  105. tracks/0/path = NodePath("Sprite2D:frame")
  106. tracks/0/interp = 1
  107. tracks/0/loop_wrap = true
  108. tracks/0/keys = {
  109. "times": PackedFloat32Array(0),
  110. "transitions": PackedFloat32Array(1),
  111. "update": 1,
  112. "values": [46]
  113. }
  114. [sub_resource type="Animation" id="8"]
  115. length = 0.6
  116. loop_mode = 1
  117. tracks/0/type = "value"
  118. tracks/0/imported = false
  119. tracks/0/enabled = true
  120. tracks/0/path = NodePath("Sprite2D:frame")
  121. tracks/0/interp = 1
  122. tracks/0/loop_wrap = true
  123. tracks/0/keys = {
  124. "times": PackedFloat32Array(0, 0.06003, 0.12006, 0.18009, 0.24012, 0.30015, 0.36018, 0.42021, 0.48024, 0.54027),
  125. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  126. "update": 1,
  127. "values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  128. }
  129. [sub_resource type="Animation" id="9"]
  130. length = 0.6
  131. tracks/0/type = "value"
  132. tracks/0/imported = false
  133. tracks/0/enabled = true
  134. tracks/0/path = NodePath("Sprite2D:frame")
  135. tracks/0/interp = 1
  136. tracks/0/loop_wrap = true
  137. tracks/0/keys = {
  138. "times": PackedFloat32Array(0, 0.06, 0.12, 0.18, 0.24, 0.3, 0.36, 0.42, 0.48, 0.54),
  139. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
  140. "update": 1,
  141. "values": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
  142. }
  143. [sub_resource type="Animation" id="10"]
  144. length = 1.25
  145. loop_mode = 1
  146. step = 0.25
  147. tracks/0/type = "value"
  148. tracks/0/imported = false
  149. tracks/0/enabled = true
  150. tracks/0/path = NodePath("Sprite2D:frame")
  151. tracks/0/interp = 1
  152. tracks/0/loop_wrap = true
  153. tracks/0/keys = {
  154. "times": PackedFloat32Array(0, 0.25, 0.75, 1),
  155. "transitions": PackedFloat32Array(1, 1, 1, 1),
  156. "update": 1,
  157. "values": [34, 35, 36, 37]
  158. }
  159. [sub_resource type="AnimationLibrary" id="AnimationLibrary_jnr5f"]
  160. _data = {
  161. "crouch": SubResource("1"),
  162. "falling": SubResource("2"),
  163. "falling_weapon": SubResource("3"),
  164. "idle": SubResource("4"),
  165. "idle_weapon": SubResource("5"),
  166. "jumping": SubResource("6"),
  167. "jumping_weapon": SubResource("7"),
  168. "run": SubResource("8"),
  169. "run_weapon": SubResource("9"),
  170. "standing_weapon_ready": SubResource("10")
  171. }
  172. [sub_resource type="RectangleShape2D" id="11"]
  173. size = Vector2(42.5, 54.5)
  174. [node name="Player" type="CharacterBody2D"]
  175. scale = Vector2(0.8, 0.8)
  176. collision_mask = 30
  177. floor_constant_speed = true
  178. platform_on_leave = 2
  179. script = ExtResource("3")
  180. [node name="ShootAnimation" type="Timer" parent="."]
  181. wait_time = 0.2
  182. one_shot = true
  183. [node name="PlatformDetector" type="RayCast2D" parent="."]
  184. target_position = Vector2(0, 6)
  185. collision_mask = 8
  186. [node name="Sprite2D" type="Sprite2D" parent="."]
  187. position = Vector2(0, -14)
  188. texture = ExtResource("9")
  189. hframes = 8
  190. vframes = 8
  191. [node name="Gun" type="Marker2D" parent="Sprite2D"]
  192. position = Vector2(14, 1)
  193. script = ExtResource("8")
  194. [node name="Shoot" type="AudioStreamPlayer2D" parent="Sprite2D/Gun"]
  195. position = Vector2(-30.6589, -6.13176)
  196. stream = ExtResource("6")
  197. [node name="Cooldown" type="Timer" parent="Sprite2D/Gun"]
  198. wait_time = 0.3
  199. one_shot = true
  200. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  201. libraries = {
  202. "": SubResource("AnimationLibrary_jnr5f")
  203. }
  204. [node name="Camera" type="Camera2D" parent="."]
  205. position = Vector2(0, -28)
  206. offset = Vector2(0, 50)
  207. limit_left = -715
  208. limit_top = -250
  209. limit_right = 1425
  210. limit_bottom = 690
  211. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  212. position = Vector2(0, -14)
  213. shape = SubResource("11")
  214. [node name="Jump" type="AudioStreamPlayer2D" parent="."]
  215. stream = ExtResource("5")
  216. volume_db = -3.0
  217. [node name="UI" type="CanvasLayer" parent="."]
  218. layer = 0
  219. [node name="Left" type="TouchScreenButton" parent="UI"]
  220. position = Vector2(157, 813)
  221. scale = Vector2(2, 2)
  222. passby_press = true
  223. action = "move_left"
  224. visibility_mode = 1
  225. [node name="Right" type="TouchScreenButton" parent="UI"]
  226. position = Vector2(425, 813)
  227. scale = Vector2(2, 2)
  228. passby_press = true
  229. action = "move_right"
  230. visibility_mode = 1
  231. [node name="Jump" type="TouchScreenButton" parent="UI"]
  232. position = Vector2(1871, 813)
  233. scale = Vector2(2, 2)
  234. action = "jump"
  235. visibility_mode = 1
  236. [node name="Fire" type="TouchScreenButton" parent="UI"]
  237. position = Vector2(1870, 564)
  238. scale = Vector2(2, 2)
  239. action = "shoot"
  240. visibility_mode = 1