test_character_pixels.tscn 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. [gd_scene load_steps=12 format=3 uid="uid://bxx2ftwccdlft"]
  2. [ext_resource type="Script" path="res://tests/functional/test_character_pixels.gd" id="1"]
  3. [ext_resource type="Script" path="res://utils/rigidbody_controller.gd" id="2"]
  4. [ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="res://tests/test_options.tscn" id="3"]
  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/characterbody_controller.gd" id="7"]
  7. [sub_resource type="RectangleShape2D" id="3"]
  8. size = Vector2(6, 9.8)
  9. [sub_resource type="RectangleShape2D" id="RectangleShape2D_scs3g"]
  10. size = Vector2(6, 4.8)
  11. [sub_resource type="SeparationRayShape2D" id="SeparationRayShape2D_vby12"]
  12. length = 7.0
  13. [sub_resource type="PhysicsMaterial" id="1"]
  14. friction = 0.0
  15. [sub_resource type="RectangleShape2D" id="2"]
  16. size = Vector2(6, 10)
  17. [sub_resource type="RectangleShape2D" id="6"]
  18. size = Vector2(20, 4)
  19. [node name="Test" type="Node2D"]
  20. script = ExtResource( "1" )
  21. _motion_speed = 30.0
  22. _gravity_force = 2.0
  23. _jump_force = 50.0
  24. _snap_distance = 1.0
  25. [node name="ViewportContainer" type="SubViewportContainer" parent="."]
  26. anchor_right = 1.0
  27. anchor_bottom = 1.0
  28. offset_right = 1024.0
  29. offset_bottom = 600.0
  30. size_flags_horizontal = 3
  31. size_flags_vertical = 3
  32. stretch = true
  33. __meta__ = {
  34. "_edit_use_anchors_": false
  35. }
  36. [node name="Viewport" type="SubViewport" parent="ViewportContainer"]
  37. handle_input_locally = false
  38. size = Vector2i(1024, 600)
  39. size_2d_override = Vector2i(128, 75)
  40. size_2d_override_stretch = true
  41. render_target_update_mode = 4
  42. [node name="StaticSceneFlat" parent="ViewportContainer/Viewport" instance=ExtResource( "4" )]
  43. position = Vector2(0, -450)
  44. [node name="CharacterBody2D" type="CharacterBody2D" parent="ViewportContainer/Viewport"]
  45. position = Vector2(30, 40)
  46. collision_mask = 2147483649
  47. script = ExtResource( "7" )
  48. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/CharacterBody2D"]
  49. shape = SubResource( "3" )
  50. [node name="CharacterBodyRay2D" type="CharacterBody2D" parent="ViewportContainer/Viewport"]
  51. position = Vector2(30, 40)
  52. collision_mask = 2147483649
  53. script = ExtResource( "7" )
  54. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/CharacterBodyRay2D"]
  55. position = Vector2(0, -2.5)
  56. shape = SubResource( "RectangleShape2D_scs3g" )
  57. [node name="CollisionShapeRay2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/CharacterBodyRay2D"]
  58. position = Vector2(0, -2)
  59. shape = SubResource( "SeparationRayShape2D_vby12" )
  60. [node name="RigidDynamicBody2D" type="RigidDynamicBody2D" parent="ViewportContainer/Viewport"]
  61. position = Vector2(30, 40)
  62. collision_mask = 2147483649
  63. physics_material_override = SubResource( "1" )
  64. contacts_reported = 4
  65. contact_monitor = true
  66. lock_rotation = true
  67. script = ExtResource( "2" )
  68. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/RigidDynamicBody2D"]
  69. shape = SubResource( "2" )
  70. [node name="RigidBodyRay2D" type="RigidDynamicBody2D" parent="ViewportContainer/Viewport"]
  71. position = Vector2(30, 40)
  72. collision_mask = 2147483649
  73. physics_material_override = SubResource( "1" )
  74. contacts_reported = 4
  75. contact_monitor = true
  76. lock_rotation = true
  77. script = ExtResource( "2" )
  78. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/RigidBodyRay2D"]
  79. position = Vector2(0, -2.5)
  80. shape = SubResource( "RectangleShape2D_scs3g" )
  81. [node name="CollisionShapeRay2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/RigidBodyRay2D"]
  82. position = Vector2(0, -2)
  83. shape = SubResource( "SeparationRayShape2D_vby12" )
  84. [node name="Wall1" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  85. position = Vector2(20, 40)
  86. [node name="CollisionShape2D" type="CollisionShape2D" parent="SubViewportContainer/SubViewport/Wall1"]
  87. rotation = 1.5708
  88. shape = SubResource( "6" )
  89. [node name="Wall2" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  90. position = Vector2(122, 40)
  91. [node name="CollisionShape2D" type="CollisionShape2D" parent="SubViewportContainer/SubViewport/Wall2"]
  92. rotation = 1.5708
  93. shape = SubResource( "6" )
  94. [node name="Platform1" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  95. position = Vector2(50, 44)
  96. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Platform1"]
  97. shape = SubResource( "6" )
  98. one_way_collision = true
  99. [node name="Platform2" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  100. position = Vector2(80, 38)
  101. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Platform2"]
  102. shape = SubResource( "6" )
  103. [node name="Slope" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  104. position = Vector2(85, 36)
  105. [node name="CollisionShape2D" type="CollisionPolygon2D" parent="ViewportContainer/Viewport/Slope"]
  106. polygon = PackedVector2Array(0, 0, 6, 0, 22, 16, 16, 16)
  107. [node name="LabelTestType" type="Label" parent="."]
  108. offset_left = 14.0
  109. offset_top = 79.0
  110. offset_right = 145.0
  111. offset_bottom = 93.0
  112. text = "Testing: "
  113. __meta__ = {
  114. "_edit_use_anchors_": false
  115. }
  116. [node name="Options" parent="." instance=ExtResource( "3" )]
  117. [node name="LabelFloor" type="Label" parent="."]
  118. offset_left = 14.0
  119. offset_top = 237.929
  120. offset_right = 145.0
  121. offset_bottom = 251.929
  122. text = "ON FLOOR"
  123. __meta__ = {
  124. "_edit_use_anchors_": false
  125. }
  126. [node name="LabelControls" type="Label" parent="."]
  127. offset_left = 14.0
  128. offset_top = 263.291
  129. offset_right = 145.0
  130. offset_bottom = 294.291
  131. text = "LEFT/RIGHT - MOVE
  132. UP - JUMP"
  133. __meta__ = {
  134. "_edit_use_anchors_": false
  135. }