Player.tscn 7.4 KB

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