player.tscn 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. [gd_scene load_steps=20 format=2]
  2. [ext_resource path="res://player.gd" type="Script" id=1]
  3. [ext_resource path="res://robot_demo.png" type="Texture" id=2]
  4. [ext_resource path="res://sound_jump.wav" type="AudioStream" id=3]
  5. [ext_resource path="res://sound_shoot.wav" type="AudioStream" id=4]
  6. [ext_resource path="res://osb_left.png" type="Texture" id=5]
  7. [ext_resource path="res://osb_right.png" type="Texture" id=6]
  8. [ext_resource path="res://osb_jump.png" type="Texture" id=7]
  9. [ext_resource path="res://osb_fire.png" type="Texture" id=8]
  10. [sub_resource type="Animation" id=1]
  11. resource_name = "crouch"
  12. length = 0.01
  13. loop = true
  14. step = 0.25
  15. tracks/0/type = "value"
  16. tracks/0/path = NodePath("sprite:frame")
  17. tracks/0/interp = 1
  18. tracks/0/loop_wrap = true
  19. tracks/0/imported = false
  20. tracks/0/keys = {
  21. "times": PoolRealArray( 0 ),
  22. "transitions": PoolRealArray( 1 ),
  23. "update": 1,
  24. "values": [ 22 ]
  25. }
  26. [sub_resource type="Animation" id=2]
  27. resource_name = "falling"
  28. length = 0.01
  29. loop = true
  30. step = 0.25
  31. tracks/0/type = "value"
  32. tracks/0/path = NodePath("sprite:frame")
  33. tracks/0/interp = 1
  34. tracks/0/loop_wrap = true
  35. tracks/0/imported = false
  36. tracks/0/keys = {
  37. "times": PoolRealArray( 0 ),
  38. "transitions": PoolRealArray( 1 ),
  39. "update": 1,
  40. "values": [ 21 ]
  41. }
  42. [sub_resource type="Animation" id=3]
  43. resource_name = "falling_weapon"
  44. length = 0.5
  45. loop = true
  46. step = 0.25
  47. tracks/0/type = "value"
  48. tracks/0/path = NodePath("sprite:frame")
  49. tracks/0/interp = 1
  50. tracks/0/loop_wrap = true
  51. tracks/0/imported = false
  52. tracks/0/keys = {
  53. "times": PoolRealArray( 0 ),
  54. "transitions": PoolRealArray( 1 ),
  55. "update": 1,
  56. "values": [ 26 ]
  57. }
  58. [sub_resource type="Animation" id=4]
  59. length = 7.0
  60. loop = true
  61. step = 0.25
  62. tracks/0/type = "value"
  63. tracks/0/path = NodePath("sprite:frame")
  64. tracks/0/interp = 1
  65. tracks/0/loop_wrap = true
  66. tracks/0/imported = false
  67. tracks/0/keys = {
  68. "times": PoolRealArray( 0, 1.25, 1.5, 2, 4.5, 4.75, 5, 5.25 ),
  69. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1 ),
  70. "update": 1,
  71. "values": [ 16, 17, 18, 16, 19, 20, 19, 16 ]
  72. }
  73. [sub_resource type="Animation" id=5]
  74. length = 0.5
  75. loop = true
  76. step = 0.25
  77. tracks/0/type = "value"
  78. tracks/0/path = NodePath("sprite:frame")
  79. tracks/0/interp = 1
  80. tracks/0/loop_wrap = true
  81. tracks/0/imported = false
  82. tracks/0/keys = {
  83. "times": PoolRealArray( 0 ),
  84. "transitions": PoolRealArray( 1 ),
  85. "update": 1,
  86. "values": [ 25 ]
  87. }
  88. [sub_resource type="Animation" id=6]
  89. length = 0.5
  90. loop = true
  91. step = 0.25
  92. tracks/0/type = "value"
  93. tracks/0/path = NodePath("sprite:frame")
  94. tracks/0/interp = 1
  95. tracks/0/loop_wrap = true
  96. tracks/0/imported = false
  97. tracks/0/keys = {
  98. "times": PoolRealArray( 0, 0.25, 0.5 ),
  99. "transitions": PoolRealArray( 1, 1, 1 ),
  100. "update": 1,
  101. "values": [ 23, 24, 23 ]
  102. }
  103. [sub_resource type="Animation" id=7]
  104. length = 0.5
  105. loop = true
  106. step = 0.25
  107. tracks/0/type = "value"
  108. tracks/0/path = NodePath("sprite:frame")
  109. tracks/0/interp = 1
  110. tracks/0/loop_wrap = true
  111. tracks/0/imported = false
  112. tracks/0/keys = {
  113. "times": PoolRealArray( 0 ),
  114. "transitions": PoolRealArray( 1 ),
  115. "update": 1,
  116. "values": [ 26 ]
  117. }
  118. [sub_resource type="Animation" id=8]
  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="Animation" id=9]
  134. length = 1.25
  135. loop = true
  136. step = 0.25
  137. tracks/0/type = "value"
  138. tracks/0/path = NodePath("sprite:frame")
  139. tracks/0/interp = 1
  140. tracks/0/loop_wrap = true
  141. tracks/0/imported = false
  142. tracks/0/keys = {
  143. "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
  144. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
  145. "update": 1,
  146. "values": [ 5, 6, 7, 8, 9, 5 ]
  147. }
  148. [sub_resource type="Animation" id=10]
  149. length = 1.25
  150. loop = true
  151. step = 0.25
  152. tracks/0/type = "value"
  153. tracks/0/path = NodePath("sprite:frame")
  154. tracks/0/interp = 1
  155. tracks/0/loop_wrap = true
  156. tracks/0/imported = false
  157. tracks/0/keys = {
  158. "times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
  159. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
  160. "update": 1,
  161. "values": [ 10, 11, 12, 13, 14, 5 ]
  162. }
  163. [sub_resource type="CapsuleShape2D" id=11]
  164. custom_solver_bias = 0.0
  165. radius = 10.0
  166. height = 44.4787
  167. [node name="player" type="KinematicBody2D"]
  168. input_pickable = false
  169. collision_layer = 1
  170. collision_mask = 1
  171. collision/safe_margin = 0.08
  172. script = ExtResource( 1 )
  173. [node name="sprite" type="Sprite" parent="."]
  174. texture = ExtResource( 2 )
  175. vframes = 2
  176. hframes = 16
  177. frame = 22
  178. [node name="smoke" type="Node2D" parent="sprite"]
  179. position = Vector2( 20.7312, 3.21187 )
  180. rotation = -1.45648
  181. [node name="bullet_shoot" type="Position2D" parent="sprite"]
  182. position = Vector2( 30.6589, 6.13176 )
  183. [node name="anim" type="AnimationPlayer" parent="."]
  184. playback_process_mode = 1
  185. playback_default_blend_time = 0.0
  186. root_node = NodePath("..")
  187. anims/crouch = SubResource( 1 )
  188. anims/falling = SubResource( 2 )
  189. anims/falling_weapon = SubResource( 3 )
  190. anims/idle = SubResource( 4 )
  191. anims/idle_weapon = SubResource( 5 )
  192. anims/jumping = SubResource( 6 )
  193. anims/jumping_weapon = SubResource( 7 )
  194. anims/run = SubResource( 8 )
  195. anims/run_weapon = SubResource( 9 )
  196. anims/standing_weapon_ready = SubResource( 10 )
  197. playback/active = true
  198. playback/speed = 2.0
  199. blend_times = [ ]
  200. autoplay = ""
  201. [node name="camera" type="Camera2D" parent="."]
  202. anchor_mode = 1
  203. rotating = false
  204. current = true
  205. zoom = Vector2( 1, 1 )
  206. limit_left = 0
  207. limit_top = 0
  208. limit_right = 10000000
  209. limit_bottom = 10000000
  210. limit_smoothed = false
  211. drag_margin_h_enabled = true
  212. drag_margin_v_enabled = true
  213. smoothing_enabled = false
  214. smoothing_speed = 5.0
  215. drag_margin_left = 0.2
  216. drag_margin_top = 0.2
  217. drag_margin_right = 0.2
  218. drag_margin_bottom = 0.2
  219. editor_draw_screen = true
  220. editor_draw_limits = false
  221. editor_draw_drag_margin = false
  222. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  223. position = Vector2( 0.291992, -0.835023 )
  224. shape = SubResource( 11 )
  225. [node name="sound_jump" type="AudioStreamPlayer2D" parent="."]
  226. stream = ExtResource( 3 )
  227. volume_db = 0.0
  228. autoplay = false
  229. max_distance = 2000.0
  230. attenuation = 1.0
  231. bus = "Master"
  232. area_mask = 1
  233. [node name="sound_shoot" type="AudioStreamPlayer2D" parent="."]
  234. stream = ExtResource( 4 )
  235. volume_db = 0.0
  236. autoplay = false
  237. max_distance = 2000.0
  238. attenuation = 1.0
  239. bus = "Master"
  240. area_mask = 1
  241. [node name="ui" type="CanvasLayer" parent="."]
  242. layer = 0
  243. offset = Vector2( 0, 0 )
  244. rotation = 0.0
  245. scale = Vector2( 1, 1 )
  246. [node name="left" type="TouchScreenButton" parent="ui"]
  247. position = Vector2( 27.7593, 360.87 )
  248. scale = Vector2( 1.49157, 1.46265 )
  249. normal = ExtResource( 5 )
  250. pressed = null
  251. bitmask = null
  252. shape = null
  253. shape_centered = true
  254. shape_visible = true
  255. passby_press = true
  256. action = "move_left"
  257. visibility_mode = 1
  258. [node name="right" type="TouchScreenButton" parent="ui"]
  259. position = Vector2( 121.542, 361.415 )
  260. scale = Vector2( 1.49157, 1.46265 )
  261. normal = ExtResource( 6 )
  262. pressed = null
  263. bitmask = null
  264. shape = null
  265. shape_centered = true
  266. shape_visible = true
  267. passby_press = true
  268. action = "move_right"
  269. visibility_mode = 1
  270. [node name="jump" type="TouchScreenButton" parent="ui"]
  271. position = Vector2( 666.224, 359.02 )
  272. scale = Vector2( 1.49157, 1.46265 )
  273. normal = ExtResource( 7 )
  274. pressed = null
  275. bitmask = null
  276. shape = null
  277. shape_centered = true
  278. shape_visible = true
  279. passby_press = false
  280. action = "jump"
  281. visibility_mode = 1
  282. [node name="fire" type="TouchScreenButton" parent="ui"]
  283. position = Vector2( 668.073, 262.788 )
  284. scale = Vector2( 1.49157, 1.46265 )
  285. normal = ExtResource( 8 )
  286. pressed = null
  287. bitmask = null
  288. shape = null
  289. shape_centered = true
  290. shape_visible = true
  291. passby_press = false
  292. action = "shoot"
  293. visibility_mode = 1