Player.tscn 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. [gd_scene load_steps=22 format=2]
  2. [ext_resource path="res://asset/body.tres" type="SpriteFrames" id=1]
  3. [ext_resource path="res://script/Boots.gd" type="Script" id=2]
  4. [ext_resource path="res://asset/lady2-Hair.png" type="Texture" id=3]
  5. [ext_resource path="res://asset/lady2-Boots.png" type="Texture" id=4]
  6. [ext_resource path="res://script/Body.gd" type="Script" id=5]
  7. [ext_resource path="res://script/Player.gd" type="Script" id=6]
  8. [ext_resource path="res://script/Hair.gd" type="Script" id=7]
  9. [ext_resource path="res://asset/radial.png" type="Texture" id=8]
  10. [ext_resource path="res://scene/StairCollider.tscn" type="PackedScene" id=9]
  11. [ext_resource path="res://scene/Walker.tscn" type="PackedScene" id=10]
  12. [sub_resource type="AtlasTexture" id=2]
  13. atlas = ExtResource( 4 )
  14. region = Rect2( 32, 0, 32, 33 )
  15. [sub_resource type="AtlasTexture" id=3]
  16. atlas = ExtResource( 4 )
  17. region = Rect2( 64, 0, 32, 33 )
  18. [sub_resource type="AtlasTexture" id=1]
  19. atlas = ExtResource( 4 )
  20. region = Rect2( 0, 0, 32, 33 )
  21. [sub_resource type="SpriteFrames" id=4]
  22. animations = [ {
  23. "frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 1 ) ],
  24. "loop": true,
  25. "name": "default",
  26. "speed": 12.0
  27. } ]
  28. [sub_resource type="AtlasTexture" id=10]
  29. atlas = ExtResource( 3 )
  30. region = Rect2( 0, 0, 32, 33 )
  31. [sub_resource type="AtlasTexture" id=11]
  32. atlas = ExtResource( 3 )
  33. region = Rect2( 32, 0, 32, 33 )
  34. [sub_resource type="AtlasTexture" id=12]
  35. atlas = ExtResource( 3 )
  36. region = Rect2( 64, 0, 32, 33 )
  37. [sub_resource type="AtlasTexture" id=13]
  38. atlas = ExtResource( 3 )
  39. region = Rect2( 96, 0, 32, 33 )
  40. [sub_resource type="SpriteFrames" id=14]
  41. animations = [ {
  42. "frames": [ SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ],
  43. "loop": true,
  44. "name": "default",
  45. "speed": 5.0
  46. } ]
  47. [sub_resource type="RectangleShape2D" id=15]
  48. extents = Vector2( 3, 8 )
  49. [sub_resource type="RectangleShape2D" id=16]
  50. extents = Vector2( 8, 8 )
  51. [node name="Player" type="KinematicBody2D"]
  52. collision/safe_margin = 0.05
  53. script = ExtResource( 6 )
  54. [node name="Walker" parent="." instance=ExtResource( 10 )]
  55. [node name="Boots" type="AnimatedSprite" parent="."]
  56. frames = SubResource( 4 )
  57. frame = 2
  58. flip_h = true
  59. script = ExtResource( 2 )
  60. [node name="Body" type="AnimatedSprite" parent="."]
  61. frames = ExtResource( 1 )
  62. frame = 2
  63. playing = true
  64. flip_h = true
  65. script = ExtResource( 5 )
  66. [node name="Hair" type="AnimatedSprite" parent="."]
  67. frames = SubResource( 14 )
  68. frame = 3
  69. playing = true
  70. flip_h = true
  71. script = ExtResource( 7 )
  72. [node name="CollisionTorso" type="CollisionShape2D" parent="."]
  73. position = Vector2( 0, 8 )
  74. shape = SubResource( 15 )
  75. [node name="CollisionHead" type="CollisionShape2D" parent="."]
  76. position = Vector2( 0, -6 )
  77. rotation = -1.5708
  78. shape = SubResource( 16 )
  79. [node name="JumpGraceTimer" type="Timer" parent="."]
  80. wait_time = 0.4
  81. one_shot = true
  82. [node name="JustJumpedTimer" type="Timer" parent="."]
  83. wait_time = 0.3
  84. one_shot = true
  85. [node name="JustFallenTimer" type="Timer" parent="."]
  86. wait_time = 0.5
  87. one_shot = true
  88. [node name="NecklaceLight" type="Light2D" parent="."]
  89. position = Vector2( 0, 6 )
  90. texture = ExtResource( 8 )
  91. texture_scale = 0.2
  92. color = Color( 1, 0, 0, 1 )
  93. energy = 0.0
  94. shadow_enabled = true
  95. [node name="LightningRay" type="RayCast2D" parent="."]
  96. position = Vector2( 0, 4 )
  97. enabled = true
  98. cast_to = Vector2( 150, 0 )
  99. collision_mask = 2
  100. [node name="StairColliderL" parent="." instance=ExtResource( 9 )]
  101. position = Vector2( -4, 17 )
  102. [node name="StairColliderR" parent="." instance=ExtResource( 9 )]
  103. position = Vector2( 4, 17 )
  104. [node name="Timer" type="Timer" parent="."]
  105. wait_time = 4.0
  106. one_shot = true
  107. [connection signal="frame_changed" from="Boots" to="Boots" method="_on_frame_changed"]
  108. [connection signal="animation_finished" from="Body" to="Body" method="_on_animation_finished"]
  109. [connection signal="animation_finished" from="Hair" to="Hair" method="_on_animation_finished"]
  110. [connection signal="timeout" from="Timer" to="." method="go_inside" flags=6]