playersprite.tscn 6.9 KB

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