playersprite.tscn 6.9 KB

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