player.tscn 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. [gd_scene load_steps=16 format=3 uid="uid://dviwgv2ty8v6u"]
  2. [ext_resource type="Script" path="res://player.gd" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://bsqovikudjr0q" path="res://charwalk.png" id="2"]
  4. [ext_resource type="FontFile" uid="uid://knb8u535cfkw" path="res://montserrat.otf" id="3"]
  5. [ext_resource type="Script" path="res://player_controls.gd" id="4_k1vfr"]
  6. [sub_resource type="CircleShape2D" id="1"]
  7. radius = 20.0
  8. [sub_resource type="Animation" id="2"]
  9. resource_name = "standing"
  10. length = 0.8
  11. loop_mode = 1
  12. tracks/0/type = "value"
  13. tracks/0/imported = false
  14. tracks/0/enabled = true
  15. tracks/0/path = NodePath("sprite:frame")
  16. tracks/0/interp = 1
  17. tracks/0/loop_wrap = true
  18. tracks/0/keys = {
  19. "times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
  20. "transitions": PackedFloat32Array(1, 1, 1, 1),
  21. "update": 1,
  22. "values": [0, 4, 8, 12]
  23. }
  24. [sub_resource type="Animation" id="3"]
  25. resource_name = "stunned"
  26. length = 1.2
  27. tracks/0/type = "value"
  28. tracks/0/imported = false
  29. tracks/0/enabled = true
  30. tracks/0/path = NodePath("sprite:frame")
  31. tracks/0/interp = 1
  32. tracks/0/loop_wrap = true
  33. tracks/0/keys = {
  34. "times": PackedFloat32Array(0),
  35. "transitions": PackedFloat32Array(1),
  36. "update": 1,
  37. "values": [0]
  38. }
  39. tracks/1/type = "value"
  40. tracks/1/imported = false
  41. tracks/1/enabled = true
  42. tracks/1/path = NodePath(".:stunned")
  43. tracks/1/interp = 1
  44. tracks/1/loop_wrap = true
  45. tracks/1/keys = {
  46. "times": PackedFloat32Array(1),
  47. "transitions": PackedFloat32Array(1),
  48. "update": 1,
  49. "values": [false]
  50. }
  51. tracks/2/type = "value"
  52. tracks/2/imported = false
  53. tracks/2/enabled = true
  54. tracks/2/path = NodePath("sprite:rotation")
  55. tracks/2/interp = 1
  56. tracks/2/loop_wrap = true
  57. tracks/2/keys = {
  58. "times": PackedFloat32Array(0, 1),
  59. "transitions": PackedFloat32Array(1, 1),
  60. "update": 0,
  61. "values": [-6.28319, 0.0]
  62. }
  63. [sub_resource type="Animation" id="4"]
  64. length = 0.8
  65. loop_mode = 1
  66. tracks/0/type = "value"
  67. tracks/0/imported = false
  68. tracks/0/enabled = true
  69. tracks/0/path = NodePath("sprite:frame")
  70. tracks/0/interp = 1
  71. tracks/0/loop_wrap = true
  72. tracks/0/keys = {
  73. "times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
  74. "transitions": PackedFloat32Array(1, 1, 1, 1),
  75. "update": 1,
  76. "values": [0, 4, 8, 12]
  77. }
  78. [sub_resource type="Animation" id="5"]
  79. length = 0.8
  80. loop_mode = 1
  81. step = 0.2
  82. tracks/0/type = "value"
  83. tracks/0/imported = false
  84. tracks/0/enabled = true
  85. tracks/0/path = NodePath("sprite:frame")
  86. tracks/0/interp = 1
  87. tracks/0/loop_wrap = true
  88. tracks/0/keys = {
  89. "times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
  90. "transitions": PackedFloat32Array(1, 1, 1, 1),
  91. "update": 1,
  92. "values": [1, 5, 9, 13]
  93. }
  94. [sub_resource type="Animation" id="6"]
  95. length = 0.8
  96. loop_mode = 1
  97. step = 0.2
  98. tracks/0/type = "value"
  99. tracks/0/imported = false
  100. tracks/0/enabled = true
  101. tracks/0/path = NodePath("sprite:frame")
  102. tracks/0/interp = 1
  103. tracks/0/loop_wrap = true
  104. tracks/0/keys = {
  105. "times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
  106. "transitions": PackedFloat32Array(1, 1, 1, 1),
  107. "update": 1,
  108. "values": [3, 7, 11, 15]
  109. }
  110. [sub_resource type="Animation" id="7"]
  111. length = 0.8
  112. loop_mode = 1
  113. step = 0.2
  114. tracks/0/type = "value"
  115. tracks/0/imported = false
  116. tracks/0/enabled = true
  117. tracks/0/path = NodePath("sprite:frame")
  118. tracks/0/interp = 1
  119. tracks/0/loop_wrap = true
  120. tracks/0/keys = {
  121. "times": PackedFloat32Array(0, 0.2, 0.4, 0.6),
  122. "transitions": PackedFloat32Array(1, 1, 1, 1),
  123. "update": 1,
  124. "values": [2, 6, 10, 14]
  125. }
  126. [sub_resource type="AnimationLibrary" id="AnimationLibrary_yb83i"]
  127. _data = {
  128. "standing": SubResource("2"),
  129. "stunned": SubResource("3"),
  130. "walk_down": SubResource("4"),
  131. "walk_left": SubResource("5"),
  132. "walk_right": SubResource("6"),
  133. "walk_up": SubResource("7")
  134. }
  135. [sub_resource type="LabelSettings" id="LabelSettings_5huhx"]
  136. outline_size = 8
  137. outline_color = Color(0, 0, 0, 1)
  138. [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_sh64w"]
  139. properties/0/path = NodePath(".:synced_position")
  140. properties/0/spawn = true
  141. properties/0/sync = true
  142. properties/0/watch = false
  143. properties/1/path = NodePath("label:text")
  144. properties/1/spawn = true
  145. properties/1/sync = false
  146. properties/1/watch = false
  147. [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_w53uu"]
  148. properties/0/path = NodePath(".:motion")
  149. properties/0/spawn = true
  150. properties/0/sync = true
  151. properties/0/watch = false
  152. properties/1/path = NodePath(".:bombing")
  153. properties/1/spawn = true
  154. properties/1/sync = true
  155. properties/1/watch = false
  156. [node name="player" type="CharacterBody2D"]
  157. z_index = 10
  158. motion_mode = 1
  159. script = ExtResource("1")
  160. [node name="sprite" type="Sprite2D" parent="."]
  161. position = Vector2(0.0750351, 6.23615)
  162. rotation = -6.28319
  163. texture = ExtResource("2")
  164. offset = Vector2(-0.0750351, -6.23615)
  165. hframes = 4
  166. vframes = 4
  167. [node name="shape" type="CollisionShape2D" parent="."]
  168. shape = SubResource("1")
  169. [node name="anim" type="AnimationPlayer" parent="."]
  170. libraries = {
  171. "": SubResource("AnimationLibrary_yb83i")
  172. }
  173. [node name="label" type="Label" parent="."]
  174. offset_left = -82.0
  175. offset_top = -35.0
  176. offset_right = 85.0
  177. offset_bottom = -14.0
  178. size_flags_horizontal = 2
  179. size_flags_vertical = 0
  180. theme_override_fonts/font = ExtResource("3")
  181. theme_override_font_sizes/font_size = 16
  182. text = "Player 1"
  183. label_settings = SubResource("LabelSettings_5huhx")
  184. horizontal_alignment = 1
  185. [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
  186. replication_config = SubResource("SceneReplicationConfig_sh64w")
  187. [node name="Inputs" type="Node" parent="."]
  188. script = ExtResource("4_k1vfr")
  189. [node name="InputsSync" type="MultiplayerSynchronizer" parent="Inputs"]
  190. replication_config = SubResource("SceneReplicationConfig_w53uu")