test_character_slopes.tscn 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. [gd_scene load_steps=15 format=3 uid="uid://bqmku5ewlo6j5"]
  2. [ext_resource type="Script" path="res://tests/functional/test_character.gd" id="1"]
  3. [ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="res://tests/test_options.tscn" id="3"]
  4. [ext_resource type="Script" path="res://utils/slider.gd" id="3_cd5g0"]
  5. [ext_resource type="PackedScene" uid="uid://cx2q80okt25o1" path="res://tests/static_scene_flat.tscn" id="4"]
  6. [ext_resource type="Script" path="res://utils/label_slider_value.gd" id="4_eoplu"]
  7. [ext_resource type="Script" path="res://utils/rigidbody_controller.gd" id="6"]
  8. [ext_resource type="Script" path="res://utils/characterbody_controller.gd" id="7"]
  9. [sub_resource type="CapsuleShape2D" id="3"]
  10. radius = 15.0
  11. height = 96.0
  12. [sub_resource type="CircleShape2D" id="CircleShape2D_llvur"]
  13. radius = 32.0
  14. [sub_resource type="SeparationRayShape2D" id="RayShape2D_3lv1w"]
  15. length = 64.0
  16. [sub_resource type="PhysicsMaterial" id="1"]
  17. friction = 0.0
  18. [sub_resource type="CapsuleShape2D" id="2"]
  19. radius = 15.0
  20. height = 96.0
  21. [sub_resource type="CircleShape2D" id="CircleShape2D_dr08f"]
  22. radius = 32.0
  23. [sub_resource type="SeparationRayShape2D" id="RayShape2D_w83f0"]
  24. length = 64.0
  25. [node name="Test" type="Node2D"]
  26. script = ExtResource("1")
  27. _snap_distance = 32.0
  28. _floor_max_angle = 60.0
  29. [node name="LabelTestType" type="Label" parent="."]
  30. offset_left = 14.0
  31. offset_top = 79.0
  32. offset_right = 145.0
  33. offset_bottom = 93.0
  34. text = "Testing: "
  35. [node name="Options" parent="." instance=ExtResource("3")]
  36. [node name="LabelFloor" type="Label" parent="."]
  37. offset_left = 14.0
  38. offset_top = 237.929
  39. offset_right = 145.0
  40. offset_bottom = 251.929
  41. text = "ON FLOOR"
  42. [node name="LabelControls" type="Label" parent="."]
  43. offset_left = 14.0
  44. offset_top = 263.291
  45. offset_right = 145.0
  46. offset_bottom = 294.291
  47. text = "LEFT/RIGHT - MOVE
  48. UP - JUMP"
  49. [node name="FloorMaxAngle" type="HBoxContainer" parent="."]
  50. offset_left = 14.0
  51. offset_top = 160.0
  52. offset_right = 476.0
  53. offset_bottom = 186.0
  54. theme_override_constants/separation = 20
  55. alignment = 2
  56. [node name="Label" type="Label" parent="FloorMaxAngle"]
  57. layout_mode = 2
  58. offset_right = 123.0
  59. offset_bottom = 26.0
  60. text = "Floor Max angle"
  61. [node name="HSlider" type="HSlider" parent="FloorMaxAngle"]
  62. layout_mode = 2
  63. offset_left = 143.0
  64. offset_right = 419.0
  65. offset_bottom = 16.0
  66. size_flags_horizontal = 3
  67. max_value = 180.0
  68. script = ExtResource("3_cd5g0")
  69. snap_step = 5.0
  70. [node name="LabelValue" type="Label" parent="FloorMaxAngle"]
  71. layout_mode = 2
  72. offset_left = 439.0
  73. offset_right = 462.0
  74. offset_bottom = 26.0
  75. text = "0.0"
  76. script = ExtResource("4_eoplu")
  77. [node name="CharacterBody2D" type="CharacterBody2D" parent="."]
  78. position = Vector2(100, 450)
  79. collision_mask = 2147483649
  80. script = ExtResource("7")
  81. [node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
  82. shape = SubResource("3")
  83. [node name="CharacterBodyRay2D" type="CharacterBody2D" parent="."]
  84. position = Vector2(100, 450)
  85. collision_mask = 2147483649
  86. script = ExtResource("7")
  87. [node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBodyRay2D"]
  88. position = Vector2(0, -16)
  89. shape = SubResource("CircleShape2D_llvur")
  90. [node name="CollisionShapeRay2D" type="CollisionShape2D" parent="CharacterBodyRay2D"]
  91. position = Vector2(0, -16)
  92. shape = SubResource("RayShape2D_3lv1w")
  93. [node name="RigidDynamicBody2D" type="RigidBody2D" parent="."]
  94. position = Vector2(100, 450)
  95. collision_mask = 2147483649
  96. physics_material_override = SubResource("1")
  97. contact_monitor = true
  98. lock_rotation = true
  99. script = ExtResource("6")
  100. [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidDynamicBody2D"]
  101. shape = SubResource("2")
  102. [node name="RigidBodyRay2D" type="RigidBody2D" parent="."]
  103. position = Vector2(100, 450)
  104. collision_mask = 2147483649
  105. physics_material_override = SubResource("1")
  106. contact_monitor = true
  107. lock_rotation = true
  108. script = ExtResource("6")
  109. [node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBodyRay2D"]
  110. position = Vector2(-7.62939e-06, -16)
  111. shape = SubResource("CircleShape2D_dr08f")
  112. [node name="CollisionShapeRay2D" type="CollisionShape2D" parent="RigidBodyRay2D"]
  113. position = Vector2(-7.62939e-06, -16)
  114. shape = SubResource("RayShape2D_w83f0")
  115. [node name="StaticSceneFlat" parent="." instance=ExtResource("4")]
  116. position = Vector2(0, 12)
  117. [node name="StaticBody2D" type="StaticBody2D" parent="."]
  118. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"]
  119. polygon = PackedVector2Array(171.04, 529.248, 379.275, 294.316, 506.084, 429.135, 648.26, 322.058, 868.746, 322.058, 985.282, 36.6919, 1242.91, 531.917)
  120. [connection signal="value_changed" from="FloorMaxAngle/HSlider" to="." method="_update_floor_max_angle"]