player.tscn 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. [gd_scene load_steps=20 format=3 uid="uid://bbxsp4gp554vh"]
  2. [ext_resource type="Script" path="res://player/player.gd" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://dh57uloeigwj6" path="res://player/player.webp" id="2_675nc"]
  4. [ext_resource type="Texture2D" uid="uid://7sv64orewgmb" path="res://player/bullet.png" id="3"]
  5. [ext_resource type="AudioStream" uid="uid://gw2a4ii0oby2" path="res://audio/sound_shoot.wav" id="8"]
  6. [ext_resource type="AudioStream" uid="uid://bpyko2i13mj0v" path="res://audio/sound_jump.wav" id="9"]
  7. [sub_resource type="PhysicsMaterial" id="1"]
  8. friction = 0.0
  9. [sub_resource type="Gradient" id="2"]
  10. colors = PackedColorArray(0.708353, 0.72498, 1, 1, 1, 1, 1, 0)
  11. [sub_resource type="Animation" id="3"]
  12. length = 0.01
  13. step = 0.25
  14. tracks/0/type = "value"
  15. tracks/0/imported = false
  16. tracks/0/enabled = true
  17. tracks/0/path = NodePath("Sprite2D:frame")
  18. tracks/0/interp = 1
  19. tracks/0/loop_wrap = true
  20. tracks/0/keys = {
  21. "times": PackedFloat32Array(0),
  22. "transitions": PackedFloat32Array(1),
  23. "update": 1,
  24. "values": [22]
  25. }
  26. [sub_resource type="Animation" id="4"]
  27. length = 0.01
  28. step = 0.25
  29. tracks/0/type = "value"
  30. tracks/0/imported = false
  31. tracks/0/enabled = true
  32. tracks/0/path = NodePath("Sprite2D:frame")
  33. tracks/0/interp = 1
  34. tracks/0/loop_wrap = true
  35. tracks/0/keys = {
  36. "times": PackedFloat32Array(0),
  37. "transitions": PackedFloat32Array(1),
  38. "update": 1,
  39. "values": [21]
  40. }
  41. [sub_resource type="Animation" id="5"]
  42. length = 0.5
  43. step = 0.25
  44. tracks/0/type = "value"
  45. tracks/0/imported = false
  46. tracks/0/enabled = true
  47. tracks/0/path = NodePath("Sprite2D:frame")
  48. tracks/0/interp = 1
  49. tracks/0/loop_wrap = true
  50. tracks/0/keys = {
  51. "times": PackedFloat32Array(0),
  52. "transitions": PackedFloat32Array(1),
  53. "update": 1,
  54. "values": [26]
  55. }
  56. [sub_resource type="Animation" id="6"]
  57. length = 7.0
  58. step = 0.25
  59. tracks/0/type = "value"
  60. tracks/0/imported = false
  61. tracks/0/enabled = true
  62. tracks/0/path = NodePath("Sprite2D:frame")
  63. tracks/0/interp = 1
  64. tracks/0/loop_wrap = true
  65. tracks/0/keys = {
  66. "times": PackedFloat32Array(0, 1.25, 1.5, 2, 4.5, 4.75, 5, 5.25),
  67. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
  68. "update": 1,
  69. "values": [16, 17, 18, 16, 19, 20, 19, 16]
  70. }
  71. [sub_resource type="Animation" id="7"]
  72. length = 0.5
  73. step = 0.25
  74. tracks/0/type = "value"
  75. tracks/0/imported = false
  76. tracks/0/enabled = true
  77. tracks/0/path = NodePath("Sprite2D:frame")
  78. tracks/0/interp = 1
  79. tracks/0/loop_wrap = true
  80. tracks/0/keys = {
  81. "times": PackedFloat32Array(0),
  82. "transitions": PackedFloat32Array(1),
  83. "update": 1,
  84. "values": [25]
  85. }
  86. [sub_resource type="Animation" id="8"]
  87. length = 0.5
  88. step = 0.25
  89. tracks/0/type = "value"
  90. tracks/0/imported = false
  91. tracks/0/enabled = true
  92. tracks/0/path = NodePath("Sprite2D:frame")
  93. tracks/0/interp = 1
  94. tracks/0/loop_wrap = true
  95. tracks/0/keys = {
  96. "times": PackedFloat32Array(0, 0.25, 0.5),
  97. "transitions": PackedFloat32Array(1, 1, 1),
  98. "update": 1,
  99. "values": [23, 24, 23]
  100. }
  101. [sub_resource type="Animation" id="9"]
  102. length = 0.5
  103. step = 0.25
  104. tracks/0/type = "value"
  105. tracks/0/imported = false
  106. tracks/0/enabled = true
  107. tracks/0/path = NodePath("Sprite2D:frame")
  108. tracks/0/interp = 1
  109. tracks/0/loop_wrap = true
  110. tracks/0/keys = {
  111. "times": PackedFloat32Array(0),
  112. "transitions": PackedFloat32Array(1),
  113. "update": 1,
  114. "values": [26]
  115. }
  116. [sub_resource type="Animation" id="10"]
  117. length = 1.25
  118. step = 0.25
  119. tracks/0/type = "value"
  120. tracks/0/imported = false
  121. tracks/0/enabled = true
  122. tracks/0/path = NodePath("Sprite2D:frame")
  123. tracks/0/interp = 1
  124. tracks/0/loop_wrap = true
  125. tracks/0/keys = {
  126. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75, 1, 1.25),
  127. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
  128. "update": 1,
  129. "values": [0, 1, 2, 3, 4, 0]
  130. }
  131. [sub_resource type="Animation" id="11"]
  132. length = 1.25
  133. step = 0.25
  134. tracks/0/type = "value"
  135. tracks/0/imported = false
  136. tracks/0/enabled = true
  137. tracks/0/path = NodePath("Sprite2D:frame")
  138. tracks/0/interp = 1
  139. tracks/0/loop_wrap = true
  140. tracks/0/keys = {
  141. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75, 1, 1.25),
  142. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
  143. "update": 1,
  144. "values": [5, 6, 7, 8, 9, 5]
  145. }
  146. [sub_resource type="Animation" id="12"]
  147. length = 1.25
  148. step = 0.25
  149. tracks/0/type = "value"
  150. tracks/0/imported = false
  151. tracks/0/enabled = true
  152. tracks/0/path = NodePath("Sprite2D:frame")
  153. tracks/0/interp = 1
  154. tracks/0/loop_wrap = true
  155. tracks/0/keys = {
  156. "times": PackedFloat32Array(0, 0.25, 0.5, 0.75, 1, 1.25),
  157. "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
  158. "update": 1,
  159. "values": [10, 11, 12, 13, 14, 5]
  160. }
  161. [sub_resource type="AnimationLibrary" id="AnimationLibrary_30623"]
  162. _data = {
  163. "crouch": SubResource("3"),
  164. "falling": SubResource("4"),
  165. "falling_weapon": SubResource("5"),
  166. "idle": SubResource("6"),
  167. "idle_weapon": SubResource("7"),
  168. "jumping": SubResource("8"),
  169. "jumping_weapon": SubResource("9"),
  170. "run": SubResource("10"),
  171. "run_weapon": SubResource("11"),
  172. "standing_weapon_ready": SubResource("12")
  173. }
  174. [sub_resource type="SeparationRayShape2D" id="13"]
  175. custom_solver_bias = 0.5
  176. length = 18.0
  177. [node name="Player" type="RigidBody2D"]
  178. mass = 1.5
  179. physics_material_override = SubResource("1")
  180. custom_integrator = true
  181. max_contacts_reported = 4
  182. contact_monitor = true
  183. lock_rotation = true
  184. script = ExtResource("1")
  185. [node name="Sprite2D" type="Sprite2D" parent="."]
  186. texture = ExtResource("2_675nc")
  187. hframes = 16
  188. vframes = 2
  189. [node name="Smoke" type="CPUParticles2D" parent="Sprite2D"]
  190. self_modulate = Color(1, 1, 1, 0.26702)
  191. position = Vector2(10, 1.5)
  192. rotation = -1.45648
  193. emitting = false
  194. lifetime = 0.3
  195. one_shot = true
  196. explosiveness = 1.0
  197. texture = ExtResource("3")
  198. spread = 65.84
  199. gravity = Vector2(0, -15)
  200. color_ramp = SubResource("2")
  201. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  202. libraries = {
  203. "": SubResource("AnimationLibrary_30623")
  204. }
  205. [node name="Camera2D" type="Camera2D" parent="."]
  206. zoom = Vector2(2, 2)
  207. limit_left = 0
  208. limit_top = 0
  209. [node name="BulletShoot" type="Marker2D" parent="."]
  210. position = Vector2(15, 2)
  211. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  212. position = Vector2(0.15, -6)
  213. shape = SubResource("13")
  214. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
  215. polygon = PackedVector2Array(-0.138, 8.25, -10, -12, 11, -12)
  216. [node name="UI" type="CanvasLayer" parent="."]
  217. layer = 0
  218. [node name="Left" type="TouchScreenButton" parent="UI"]
  219. position = Vector2(27.7593, 360.87)
  220. scale = Vector2(1.49157, 1.46265)
  221. passby_press = true
  222. action = "move_left"
  223. visibility_mode = 1
  224. [node name="Right" type="TouchScreenButton" parent="UI"]
  225. position = Vector2(121.542, 361.415)
  226. scale = Vector2(1.49157, 1.46265)
  227. passby_press = true
  228. action = "move_right"
  229. visibility_mode = 1
  230. [node name="Jump" type="TouchScreenButton" parent="UI"]
  231. position = Vector2(666.224, 359.02)
  232. scale = Vector2(1.49157, 1.46265)
  233. action = "jump"
  234. visibility_mode = 1
  235. [node name="Fire" type="TouchScreenButton" parent="UI"]
  236. position = Vector2(668.073, 262.788)
  237. scale = Vector2(1.49157, 1.46265)
  238. action = "shoot"
  239. visibility_mode = 1
  240. [node name="SoundShoot" type="AudioStreamPlayer2D" parent="."]
  241. stream = ExtResource("8")
  242. [node name="SoundJump" type="AudioStreamPlayer2D" parent="."]
  243. stream = ExtResource("9")