playersprite.tscn 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. [gd_scene load_steps=16 format=2]
  2. [ext_resource path="res://NPC/soldier/soldieranim.tscn" type="PackedScene" id=1]
  3. [ext_resource path="res://art/NPC/soldier/helmet.png" type="Texture" id=2]
  4. [ext_resource path="res://art/NPC/soldier/soldieremotions.png" type="Texture" id=3]
  5. [ext_resource path="res://font/yoster.ttf" type="DynamicFontData" id=5]
  6. [ext_resource path="res://art/NPC/soldier/soldiertest.png" type="Texture" id=6]
  7. [ext_resource path="res://art/NPC/soldier/head2.png" type="Texture" id=7]
  8. [sub_resource type="GDScript" id=28]
  9. script/source = "extends Node2D
  10. export var animation = 'idle'
  11. export var flip_h = false
  12. var die = false
  13. func _ready():
  14. for x in get_tree().get_nodes_in_group('client'):
  15. print( x.usernamelist)
  16. $username.text = x.usernamelist[int(name)]
  17. func _physics_process(delta):
  18. if die:
  19. $SoldierAnim/AnimationPlayer.play('die4')
  20. else:
  21. $SoldierAnim/AnimationPlayer.play(animation)
  22. $SoldierAnim.scale.x = -1 if flip_h else 1
  23. func shooting():
  24. $SoldierAnim/AnimationPlayer3.play(\"point\")
  25. # yield(get_tree().create_timer(0.4),\"timeout\")
  26. # $SoldierAnim/AnimationPlayer3.stop()
  27. func level_up_anim():
  28. $AnimationPlayer.play('leveup')
  29. func message(arg):
  30. $message.text = arg
  31. $AnimationPlayer3.play(\"msg\")
  32. func _die():
  33. print('die3')
  34. die = true
  35. # Called every frame. 'delta' is the elapsed time since the previous frame.
  36. #func _process(delta):
  37. # pass
  38. "
  39. [sub_resource type="Animation" id=29]
  40. resource_name = "leveup"
  41. length = 2.0
  42. tracks/0/type = "value"
  43. tracks/0/path = NodePath("Label/Label:rect_position")
  44. tracks/0/interp = 1
  45. tracks/0/loop_wrap = true
  46. tracks/0/imported = false
  47. tracks/0/enabled = true
  48. tracks/0/keys = {
  49. "times": PoolRealArray( 0, 2 ),
  50. "transitions": PoolRealArray( 1, 1 ),
  51. "update": 0,
  52. "values": [ Vector2( -29.5, -6 ), Vector2( -29.5, -67.1752 ) ]
  53. }
  54. tracks/1/type = "value"
  55. tracks/1/path = NodePath("Label/Label:rect_scale")
  56. tracks/1/interp = 1
  57. tracks/1/loop_wrap = true
  58. tracks/1/imported = false
  59. tracks/1/enabled = true
  60. tracks/1/keys = {
  61. "times": PoolRealArray( 0, 0.2, 1.3, 2 ),
  62. "transitions": PoolRealArray( 1, 1, 1, 1 ),
  63. "update": 0,
  64. "values": [ Vector2( 0, 3 ), Vector2( 1, 1 ), Vector2( 1, 1 ), Vector2( 3, 0 ) ]
  65. }
  66. tracks/2/type = "value"
  67. tracks/2/path = NodePath("Line2D:modulate")
  68. tracks/2/interp = 1
  69. tracks/2/loop_wrap = true
  70. tracks/2/imported = false
  71. tracks/2/enabled = true
  72. tracks/2/keys = {
  73. "times": PoolRealArray( 0, 0.2, 1.3, 2 ),
  74. "transitions": PoolRealArray( 1, 1, 1, 1 ),
  75. "update": 0,
  76. "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
  77. }
  78. [sub_resource type="Animation" id=30]
  79. resource_name = "leveup"
  80. length = 0.2
  81. loop = true
  82. tracks/0/type = "value"
  83. tracks/0/path = NodePath("Label/Label:custom_colors/font_color")
  84. tracks/0/interp = 1
  85. tracks/0/loop_wrap = true
  86. tracks/0/imported = false
  87. tracks/0/enabled = true
  88. tracks/0/keys = {
  89. "times": PoolRealArray( 0, 0.1 ),
  90. "transitions": PoolRealArray( 1, 1 ),
  91. "update": 0,
  92. "values": [ Color( 1, 0.717647, 0.305882, 1 ), Color( 0.631373, 1, 1, 1 ) ]
  93. }
  94. tracks/1/type = "value"
  95. tracks/1/path = NodePath("Label/Label:custom_colors/font_outline_modulate")
  96. tracks/1/interp = 1
  97. tracks/1/loop_wrap = true
  98. tracks/1/imported = false
  99. tracks/1/enabled = true
  100. tracks/1/keys = {
  101. "times": PoolRealArray( 0, 0.1 ),
  102. "transitions": PoolRealArray( 1, 1 ),
  103. "update": 0,
  104. "values": [ Color( 1, 0.156863, 0.0470588, 1 ), Color( 0.0784314, 0.286275, 0.552941, 1 ) ]
  105. }
  106. [sub_resource type="Shader" id=31]
  107. code = "shader_type canvas_item;
  108. render_mode blend_mix;
  109. void vertex(){
  110. VERTEX.y += (sin(TIME*32f)* mix(VERTEX.x,1f,0.8));
  111. }"
  112. [sub_resource type="ShaderMaterial" id=32]
  113. shader = SubResource( 31 )
  114. [sub_resource type="Gradient" id=33]
  115. offsets = PoolRealArray( 0.510949, 1 )
  116. colors = PoolColorArray( 1, 1, 1, 0.411765, 1, 1, 1, 0 )
  117. [sub_resource type="DynamicFont" id=34]
  118. size = 12
  119. outline_size = 2
  120. font_data = ExtResource( 5 )
  121. [sub_resource type="Animation" id=35]
  122. length = 0.001
  123. tracks/0/type = "value"
  124. tracks/0/path = NodePath("message:visible")
  125. tracks/0/interp = 1
  126. tracks/0/loop_wrap = true
  127. tracks/0/imported = false
  128. tracks/0/enabled = true
  129. tracks/0/keys = {
  130. "times": PoolRealArray( 0 ),
  131. "transitions": PoolRealArray( 1 ),
  132. "update": 0,
  133. "values": [ true ]
  134. }
  135. tracks/1/type = "value"
  136. tracks/1/path = NodePath("message:rect_scale")
  137. tracks/1/interp = 1
  138. tracks/1/loop_wrap = true
  139. tracks/1/imported = false
  140. tracks/1/enabled = true
  141. tracks/1/keys = {
  142. "times": PoolRealArray( 0 ),
  143. "transitions": PoolRealArray( 1 ),
  144. "update": 0,
  145. "values": [ Vector2( 1e-05, 1e-05 ) ]
  146. }
  147. [sub_resource type="Animation" id=36]
  148. resource_name = "msg"
  149. length = 5.0
  150. tracks/0/type = "value"
  151. tracks/0/path = NodePath("message:visible")
  152. tracks/0/interp = 1
  153. tracks/0/loop_wrap = true
  154. tracks/0/imported = false
  155. tracks/0/enabled = true
  156. tracks/0/keys = {
  157. "times": PoolRealArray( 0, 5 ),
  158. "transitions": PoolRealArray( 1, 1 ),
  159. "update": 1,
  160. "values": [ true, false ]
  161. }
  162. tracks/1/type = "value"
  163. tracks/1/path = NodePath("message:rect_scale")
  164. tracks/1/interp = 2
  165. tracks/1/loop_wrap = true
  166. tracks/1/imported = false
  167. tracks/1/enabled = true
  168. tracks/1/keys = {
  169. "times": PoolRealArray( 0, 0.2, 0.4, 4.6, 4.8, 5 ),
  170. "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
  171. "update": 0,
  172. "values": [ Vector2( 1e-05, 1e-05 ), Vector2( 1.25, 1.25 ), Vector2( 1.25, 1.25 ), Vector2( 1.25, 1.25 ), Vector2( 1.25, 1.25 ), Vector2( 1e-05, 1e-05 ) ]
  173. }
  174. [node name="playersprite" type="Node2D" groups=["playersprite"]]
  175. z_index = 999
  176. script = SubResource( 28 )
  177. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  178. anims/leveup = SubResource( 29 )
  179. [node name="AnimationPlayer2" type="AnimationPlayer" parent="."]
  180. autoplay = "leveup"
  181. anims/leveup = SubResource( 30 )
  182. [node name="Line2D" type="Line2D" parent="."]
  183. modulate = Color( 1, 1, 1, 0 )
  184. material = SubResource( 32 )
  185. points = PoolVector2Array( 0, 25, -0.651, -65 )
  186. width = 32.0
  187. default_color = Color( 1, 1, 1, 1 )
  188. gradient = SubResource( 33 )
  189. [node name="Label" type="Node2D" parent="."]
  190. [node name="Label" type="Label" parent="Label"]
  191. anchor_left = 0.5
  192. anchor_top = 0.5
  193. anchor_right = 0.5
  194. anchor_bottom = 0.5
  195. margin_left = -29.5
  196. margin_top = -6.0
  197. margin_right = 29.5
  198. margin_bottom = 6.0
  199. rect_scale = Vector2( 1e-05, 3 )
  200. rect_pivot_offset = Vector2( 27.5174, 6.3988 )
  201. custom_colors/font_color = Color( 1, 0.717647, 0.305882, 1 )
  202. custom_colors/font_outline_modulate = Color( 1, 0.156863, 0.0470588, 1 )
  203. custom_fonts/font = SubResource( 34 )
  204. text = "Level Up"
  205. align = 1
  206. valign = 1
  207. [node name="message" type="Label" parent="."]
  208. margin_left = -50.0
  209. margin_top = -131.839
  210. margin_right = 50.0
  211. margin_bottom = -71.839
  212. rect_scale = Vector2( 1e-05, 1e-05 )
  213. rect_pivot_offset = Vector2( 50, 0 )
  214. align = 1
  215. valign = 1
  216. autowrap = true
  217. clip_text = true
  218. [node name="ColorRect" type="ColorRect" parent="message"]
  219. show_behind_parent = true
  220. anchor_right = 1.0
  221. anchor_bottom = 1.0
  222. color = Color( 0, 0, 0, 0.333333 )
  223. [node name="AnimationPlayer3" type="AnimationPlayer" parent="."]
  224. anims/RESET = SubResource( 35 )
  225. anims/msg = SubResource( 36 )
  226. [node name="SoldierAnim" parent="." instance=ExtResource( 1 )]
  227. position = Vector2( 0, -21 )
  228. z_index = 4
  229. text = null
  230. text1 = ExtResource( 6 )
  231. text2 = ExtResource( 7 )
  232. text3 = ExtResource( 3 )
  233. text4 = ExtResource( 2 )
  234. [node name="username" type="Label" parent="."]
  235. anchor_right = 1.0
  236. margin_left = -316.031
  237. margin_top = -46.0209
  238. margin_right = 323.969
  239. margin_bottom = -32.0209
  240. align = 1
  241. valign = 1