npc.tscn 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. [gd_scene load_steps=42 format=3 uid="uid://dxcvuxgvdsx7"]
  2. [ext_resource type="Script" uid="uid://cedfqqodwcl2a" path="res://scripts/npc.gd" id="1_abqhh"]
  3. [ext_resource type="Texture2D" uid="uid://c4eg1isjbtsp" path="res://assets/characters/character_2.png" id="1_nh2m4"]
  4. [sub_resource type="RectangleShape2D" id="RectangleShape2D_abqhh"]
  5. size = Vector2(37, 58)
  6. [sub_resource type="AtlasTexture" id="AtlasTexture_abqhh"]
  7. atlas = ExtResource("1_nh2m4")
  8. region = Rect2(0, 595, 48, 80)
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_rv78h"]
  10. atlas = ExtResource("1_nh2m4")
  11. region = Rect2(48, 595, 48, 80)
  12. [sub_resource type="AtlasTexture" id="AtlasTexture_7n8xq"]
  13. atlas = ExtResource("1_nh2m4")
  14. region = Rect2(96, 595, 48, 80)
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_4wlns"]
  16. atlas = ExtResource("1_nh2m4")
  17. region = Rect2(144, 595, 48, 80)
  18. [sub_resource type="AtlasTexture" id="AtlasTexture_tl2vt"]
  19. atlas = ExtResource("1_nh2m4")
  20. region = Rect2(192, 595, 48, 80)
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_hwkja"]
  22. atlas = ExtResource("1_nh2m4")
  23. region = Rect2(240, 595, 48, 80)
  24. [sub_resource type="AtlasTexture" id="AtlasTexture_0tygy"]
  25. atlas = ExtResource("1_nh2m4")
  26. region = Rect2(288, 595, 48, 80)
  27. [sub_resource type="AtlasTexture" id="AtlasTexture_sptji"]
  28. atlas = ExtResource("1_nh2m4")
  29. region = Rect2(336, 595, 48, 80)
  30. [sub_resource type="AtlasTexture" id="AtlasTexture_v4e37"]
  31. atlas = ExtResource("1_nh2m4")
  32. region = Rect2(384, 595, 48, 80)
  33. [sub_resource type="AtlasTexture" id="AtlasTexture_1h837"]
  34. atlas = ExtResource("1_nh2m4")
  35. region = Rect2(432, 595, 48, 80)
  36. [sub_resource type="AtlasTexture" id="AtlasTexture_gl1un"]
  37. atlas = ExtResource("1_nh2m4")
  38. region = Rect2(480, 595, 48, 80)
  39. [sub_resource type="AtlasTexture" id="AtlasTexture_wuru7"]
  40. atlas = ExtResource("1_nh2m4")
  41. region = Rect2(528, 595, 48, 80)
  42. [sub_resource type="AtlasTexture" id="AtlasTexture_nyaq3"]
  43. atlas = ExtResource("1_nh2m4")
  44. region = Rect2(864, 792, 48, 70)
  45. [sub_resource type="AtlasTexture" id="AtlasTexture_yf2ql"]
  46. atlas = ExtResource("1_nh2m4")
  47. region = Rect2(912, 792, 48, 70)
  48. [sub_resource type="AtlasTexture" id="AtlasTexture_8gbmn"]
  49. atlas = ExtResource("1_nh2m4")
  50. region = Rect2(960, 792, 48, 70)
  51. [sub_resource type="AtlasTexture" id="AtlasTexture_pvipr"]
  52. atlas = ExtResource("1_nh2m4")
  53. region = Rect2(1008, 792, 48, 70)
  54. [sub_resource type="AtlasTexture" id="AtlasTexture_n0klm"]
  55. atlas = ExtResource("1_nh2m4")
  56. region = Rect2(1056, 792, 48, 70)
  57. [sub_resource type="AtlasTexture" id="AtlasTexture_u2tho"]
  58. atlas = ExtResource("1_nh2m4")
  59. region = Rect2(1104, 792, 48, 70)
  60. [sub_resource type="AtlasTexture" id="AtlasTexture_ca6vw"]
  61. atlas = ExtResource("1_nh2m4")
  62. region = Rect2(576, 792, 48, 70)
  63. [sub_resource type="AtlasTexture" id="AtlasTexture_t8u8m"]
  64. atlas = ExtResource("1_nh2m4")
  65. region = Rect2(624, 792, 48, 70)
  66. [sub_resource type="AtlasTexture" id="AtlasTexture_d56e8"]
  67. atlas = ExtResource("1_nh2m4")
  68. region = Rect2(672, 792, 48, 70)
  69. [sub_resource type="AtlasTexture" id="AtlasTexture_ewlk4"]
  70. atlas = ExtResource("1_nh2m4")
  71. region = Rect2(720, 792, 48, 70)
  72. [sub_resource type="AtlasTexture" id="AtlasTexture_bw2c7"]
  73. atlas = ExtResource("1_nh2m4")
  74. region = Rect2(768, 792, 48, 70)
  75. [sub_resource type="AtlasTexture" id="AtlasTexture_gc4mq"]
  76. atlas = ExtResource("1_nh2m4")
  77. region = Rect2(816, 792, 48, 70)
  78. [sub_resource type="AtlasTexture" id="AtlasTexture_2gr28"]
  79. atlas = ExtResource("1_nh2m4")
  80. region = Rect2(0, 792, 48, 70)
  81. [sub_resource type="AtlasTexture" id="AtlasTexture_tkdcp"]
  82. atlas = ExtResource("1_nh2m4")
  83. region = Rect2(48, 792, 48, 70)
  84. [sub_resource type="AtlasTexture" id="AtlasTexture_15fp6"]
  85. atlas = ExtResource("1_nh2m4")
  86. region = Rect2(96, 792, 48, 70)
  87. [sub_resource type="AtlasTexture" id="AtlasTexture_bll4x"]
  88. atlas = ExtResource("1_nh2m4")
  89. region = Rect2(144, 792, 48, 70)
  90. [sub_resource type="AtlasTexture" id="AtlasTexture_46t2e"]
  91. atlas = ExtResource("1_nh2m4")
  92. region = Rect2(192, 792, 48, 70)
  93. [sub_resource type="AtlasTexture" id="AtlasTexture_u8ld7"]
  94. atlas = ExtResource("1_nh2m4")
  95. region = Rect2(240, 792, 48, 70)
  96. [sub_resource type="AtlasTexture" id="AtlasTexture_jwdfw"]
  97. atlas = ExtResource("1_nh2m4")
  98. region = Rect2(288, 792, 48, 70)
  99. [sub_resource type="AtlasTexture" id="AtlasTexture_y1ua7"]
  100. atlas = ExtResource("1_nh2m4")
  101. region = Rect2(336, 792, 48, 70)
  102. [sub_resource type="AtlasTexture" id="AtlasTexture_8hjb1"]
  103. atlas = ExtResource("1_nh2m4")
  104. region = Rect2(384, 792, 48, 70)
  105. [sub_resource type="AtlasTexture" id="AtlasTexture_ub7sa"]
  106. atlas = ExtResource("1_nh2m4")
  107. region = Rect2(432, 792, 48, 70)
  108. [sub_resource type="AtlasTexture" id="AtlasTexture_fdkk8"]
  109. atlas = ExtResource("1_nh2m4")
  110. region = Rect2(480, 792, 48, 70)
  111. [sub_resource type="AtlasTexture" id="AtlasTexture_iwn7c"]
  112. atlas = ExtResource("1_nh2m4")
  113. region = Rect2(528, 792, 48, 70)
  114. [sub_resource type="SpriteFrames" id="SpriteFrames_nyaq3"]
  115. animations = [{
  116. "frames": [{
  117. "duration": 1.0,
  118. "texture": SubResource("AtlasTexture_abqhh")
  119. }, {
  120. "duration": 1.0,
  121. "texture": SubResource("AtlasTexture_rv78h")
  122. }, {
  123. "duration": 1.0,
  124. "texture": SubResource("AtlasTexture_7n8xq")
  125. }, {
  126. "duration": 1.0,
  127. "texture": SubResource("AtlasTexture_4wlns")
  128. }, {
  129. "duration": 1.0,
  130. "texture": SubResource("AtlasTexture_tl2vt")
  131. }, {
  132. "duration": 1.0,
  133. "texture": SubResource("AtlasTexture_hwkja")
  134. }, {
  135. "duration": 1.0,
  136. "texture": SubResource("AtlasTexture_0tygy")
  137. }, {
  138. "duration": 1.0,
  139. "texture": SubResource("AtlasTexture_sptji")
  140. }, {
  141. "duration": 1.0,
  142. "texture": SubResource("AtlasTexture_v4e37")
  143. }, {
  144. "duration": 1.0,
  145. "texture": SubResource("AtlasTexture_1h837")
  146. }, {
  147. "duration": 1.0,
  148. "texture": SubResource("AtlasTexture_gl1un")
  149. }, {
  150. "duration": 1.0,
  151. "texture": SubResource("AtlasTexture_wuru7")
  152. }],
  153. "loop": true,
  154. "name": &"idle",
  155. "speed": 5.0
  156. }, {
  157. "frames": [{
  158. "duration": 1.0,
  159. "texture": SubResource("AtlasTexture_nyaq3")
  160. }, {
  161. "duration": 1.0,
  162. "texture": SubResource("AtlasTexture_yf2ql")
  163. }, {
  164. "duration": 1.0,
  165. "texture": SubResource("AtlasTexture_8gbmn")
  166. }, {
  167. "duration": 1.0,
  168. "texture": SubResource("AtlasTexture_pvipr")
  169. }, {
  170. "duration": 1.0,
  171. "texture": SubResource("AtlasTexture_n0klm")
  172. }, {
  173. "duration": 1.0,
  174. "texture": SubResource("AtlasTexture_u2tho")
  175. }],
  176. "loop": true,
  177. "name": &"walk_down",
  178. "speed": 12.0
  179. }, {
  180. "frames": [{
  181. "duration": 1.0,
  182. "texture": SubResource("AtlasTexture_ca6vw")
  183. }, {
  184. "duration": 1.0,
  185. "texture": SubResource("AtlasTexture_t8u8m")
  186. }, {
  187. "duration": 1.0,
  188. "texture": SubResource("AtlasTexture_d56e8")
  189. }, {
  190. "duration": 1.0,
  191. "texture": SubResource("AtlasTexture_ewlk4")
  192. }, {
  193. "duration": 1.0,
  194. "texture": SubResource("AtlasTexture_bw2c7")
  195. }, {
  196. "duration": 1.0,
  197. "texture": SubResource("AtlasTexture_gc4mq")
  198. }],
  199. "loop": true,
  200. "name": &"walk_left",
  201. "speed": 12.0
  202. }, {
  203. "frames": [{
  204. "duration": 1.0,
  205. "texture": SubResource("AtlasTexture_2gr28")
  206. }, {
  207. "duration": 1.0,
  208. "texture": SubResource("AtlasTexture_tkdcp")
  209. }, {
  210. "duration": 1.0,
  211. "texture": SubResource("AtlasTexture_15fp6")
  212. }, {
  213. "duration": 1.0,
  214. "texture": SubResource("AtlasTexture_bll4x")
  215. }, {
  216. "duration": 1.0,
  217. "texture": SubResource("AtlasTexture_46t2e")
  218. }, {
  219. "duration": 1.0,
  220. "texture": SubResource("AtlasTexture_u8ld7")
  221. }],
  222. "loop": true,
  223. "name": &"walk_right",
  224. "speed": 12.0
  225. }, {
  226. "frames": [{
  227. "duration": 1.0,
  228. "texture": SubResource("AtlasTexture_jwdfw")
  229. }, {
  230. "duration": 1.0,
  231. "texture": SubResource("AtlasTexture_y1ua7")
  232. }, {
  233. "duration": 1.0,
  234. "texture": SubResource("AtlasTexture_8hjb1")
  235. }, {
  236. "duration": 1.0,
  237. "texture": SubResource("AtlasTexture_ub7sa")
  238. }, {
  239. "duration": 1.0,
  240. "texture": SubResource("AtlasTexture_fdkk8")
  241. }, {
  242. "duration": 1.0,
  243. "texture": SubResource("AtlasTexture_iwn7c")
  244. }],
  245. "loop": true,
  246. "name": &"walk_up",
  247. "speed": 12.0
  248. }]
  249. [sub_resource type="RectangleShape2D" id="RectangleShape2D_nh2m4"]
  250. size = Vector2(65, 86)
  251. [node name="NPC" type="CharacterBody2D"]
  252. script = ExtResource("1_abqhh")
  253. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  254. position = Vector2(0.5, 1)
  255. shape = SubResource("RectangleShape2D_abqhh")
  256. [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
  257. sprite_frames = SubResource("SpriteFrames_nyaq3")
  258. animation = &"walk_up"
  259. autoplay = "idle"
  260. [node name="InteractionArea" type="Area2D" parent="."]
  261. [node name="CollisionShape2D" type="CollisionShape2D" parent="InteractionArea"]
  262. position = Vector2(-0.5, 0)
  263. shape = SubResource("RectangleShape2D_nh2m4")
  264. [node name="NameLabel" type="Label" parent="."]
  265. offset_left = -20.0
  266. offset_top = -58.0
  267. offset_right = 20.0
  268. offset_bottom = -35.0
  269. theme_override_colors/font_color = Color(1, 1, 0.3764706, 1)
  270. text = "张三"
  271. horizontal_alignment = 1
  272. [node name="DialogueLabel" type="Label" parent="."]
  273. visible = false
  274. offset_left = 29.0
  275. offset_top = -29.0
  276. offset_right = 122.0
  277. offset_bottom = 30.0
  278. theme_override_font_sizes/font_size = 14
  279. autowrap_mode = 2