test_character_pixels.tscn 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. [gd_scene load_steps=12 format=2]
  2. [ext_resource path="res://tests/functional/test_character_pixels.gd" type="Script" id=1]
  3. [ext_resource path="res://utils/rigidbody_controller.gd" type="Script" id=2]
  4. [ext_resource path="res://tests/test_options.tscn" type="PackedScene" id=3]
  5. [ext_resource path="res://tests/static_scene_flat.tscn" type="PackedScene" id=4]
  6. [ext_resource path="res://utils/kinematicbody_controller.gd" type="Script" id=7]
  7. [sub_resource type="PhysicsMaterial" id=1]
  8. friction = 0.0
  9. [sub_resource type="RectangleShape2D" id=2]
  10. extents = Vector2( 3, 5 )
  11. [sub_resource type="RectangleShape2D" id=3]
  12. extents = Vector2( 3, 4.9 )
  13. [sub_resource type="RectangleShape2D" id=4]
  14. extents = Vector2( 3, 3 )
  15. [sub_resource type="RayShape2D" id=5]
  16. length = 3.0
  17. [sub_resource type="RectangleShape2D" id=6]
  18. extents = Vector2( 10, 2 )
  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="ViewportContainer" parent="."]
  26. anchor_right = 1.0
  27. anchor_bottom = 1.0
  28. margin_right = 1024.0
  29. margin_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="Viewport" parent="ViewportContainer"]
  37. size = Vector2( 128, 75 )
  38. handle_input_locally = false
  39. render_target_update_mode = 3
  40. [node name="StaticSceneFlat" parent="ViewportContainer/Viewport" instance=ExtResource( 4 )]
  41. position = Vector2( 0, -450 )
  42. [node name="RigidBody2D" type="RigidBody2D" parent="ViewportContainer/Viewport"]
  43. position = Vector2( 30, 40 )
  44. collision_mask = 2147483649
  45. mode = 2
  46. physics_material_override = SubResource( 1 )
  47. contacts_reported = 4
  48. contact_monitor = true
  49. script = ExtResource( 2 )
  50. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/RigidBody2D"]
  51. shape = SubResource( 2 )
  52. [node name="KinematicBody2D" type="KinematicBody2D" parent="ViewportContainer/Viewport"]
  53. position = Vector2( 30, 40 )
  54. collision_mask = 2147483649
  55. script = ExtResource( 7 )
  56. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/KinematicBody2D"]
  57. shape = SubResource( 3 )
  58. [node name="KinematicBodyRay2D" type="KinematicBody2D" parent="ViewportContainer/Viewport"]
  59. position = Vector2( 30, 40 )
  60. collision_mask = 2147483649
  61. script = ExtResource( 7 )
  62. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/KinematicBodyRay2D"]
  63. position = Vector2( 0, -2 )
  64. shape = SubResource( 4 )
  65. [node name="CollisionShapeRay2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/KinematicBodyRay2D"]
  66. position = Vector2( 0, -1 )
  67. shape = SubResource( 5 )
  68. [node name="Wall1" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  69. position = Vector2( 20, 40 )
  70. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Wall1"]
  71. rotation = 1.5708
  72. shape = SubResource( 6 )
  73. [node name="Wall2" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  74. position = Vector2( 122, 40 )
  75. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Wall2"]
  76. rotation = 1.5708
  77. shape = SubResource( 6 )
  78. [node name="Platform1" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  79. position = Vector2( 50, 44 )
  80. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Platform1"]
  81. shape = SubResource( 6 )
  82. one_way_collision = true
  83. [node name="Platform2" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  84. position = Vector2( 80, 38 )
  85. [node name="CollisionShape2D" type="CollisionShape2D" parent="ViewportContainer/Viewport/Platform2"]
  86. shape = SubResource( 6 )
  87. [node name="Slope" type="StaticBody2D" parent="ViewportContainer/Viewport"]
  88. position = Vector2( 84, 36 )
  89. [node name="CollisionShape2D" type="CollisionPolygon2D" parent="ViewportContainer/Viewport/Slope"]
  90. polygon = PoolVector2Array( 0, 0, 6, 0, 22, 16, 16, 16 )
  91. [node name="LabelTestType" type="Label" parent="."]
  92. margin_left = 14.0
  93. margin_top = 79.0
  94. margin_right = 145.0
  95. margin_bottom = 93.0
  96. text = "Testing: "
  97. __meta__ = {
  98. "_edit_use_anchors_": false
  99. }
  100. [node name="Options" parent="." instance=ExtResource( 3 )]
  101. [node name="LabelFloor" type="Label" parent="."]
  102. margin_left = 14.0
  103. margin_top = 237.929
  104. margin_right = 145.0
  105. margin_bottom = 251.929
  106. text = "ON FLOOR"
  107. __meta__ = {
  108. "_edit_use_anchors_": false
  109. }
  110. [node name="LabelControls" type="Label" parent="."]
  111. margin_left = 14.0
  112. margin_top = 263.291
  113. margin_right = 145.0
  114. margin_bottom = 294.291
  115. text = "LEFT/RIGHT - MOVE
  116. UP - JUMP"
  117. __meta__ = {
  118. "_edit_use_anchors_": false
  119. }