playersprite.tscn 7.3 KB

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