Files
godot-demo-projects/2d/physics_tests/tests/functional/test_one_way_collision.tscn
2021-03-03 02:59:17 -05:00

251 lines
6.2 KiB
Plaintext

[gd_scene load_steps=9 format=2]
[ext_resource path="res://tests/functional/test_one_way_collision.gd" type="Script" id=1]
[ext_resource path="res://icon.png" type="Texture" id=2]
[ext_resource path="res://tests/test_options.tscn" type="PackedScene" id=3]
[ext_resource path="res://utils/label_slider_value.gd" type="Script" id=4]
[ext_resource path="res://utils/slider.gd" type="Script" id=5]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 32, 32 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 64, 32 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 32, 32 )
[node name="Test" type="Node2D"]
script = ExtResource( 1 )
_enable_debug_collision = true
_platform_size = 64.0
_platform_angle = 0.0
_platform_speed = 0.0
_body_angle = 0.0
_body_velocity = Vector2( 400, 0 )
_use_kinematic_body = false
[node name="LabelTestType" type="Label" parent="."]
margin_left = 14.0
margin_top = 79.0
margin_right = 145.0
margin_bottom = 93.0
text = "Testing: "
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Options" parent="." instance=ExtResource( 3 )]
[node name="Controls" type="VBoxContainer" parent="."]
pause_mode = 2
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 25.3619
margin_top = 416.765
margin_right = 265.362
margin_bottom = 484.765
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PlatformSize" type="HBoxContainer" parent="Controls"]
margin_right = 432.0
margin_bottom = 16.0
custom_constants/separation = 20
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="Controls/PlatformSize"]
margin_left = 8.0
margin_top = 1.0
margin_right = 92.0
margin_bottom = 15.0
text = "Platform size"
[node name="HSlider" type="HSlider" parent="Controls/PlatformSize"]
margin_left = 112.0
margin_right = 312.0
margin_bottom = 16.0
rect_min_size = Vector2( 200, 0 )
min_value = 32.0
max_value = 128.0
value = 64.0
script = ExtResource( 5 )
[node name="LabelValue" type="Label" parent="Controls/PlatformSize"]
margin_left = 332.0
margin_top = 1.0
margin_right = 432.0
margin_bottom = 15.0
rect_min_size = Vector2( 100, 0 )
text = "64.0"
script = ExtResource( 4 )
[node name="PlatformAngle" type="HBoxContainer" parent="Controls"]
margin_top = 26.0
margin_right = 432.0
margin_bottom = 42.0
custom_constants/separation = 20
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="Controls/PlatformAngle"]
margin_top = 1.0
margin_right = 92.0
margin_bottom = 15.0
text = "Platform angle"
[node name="HSlider" type="HSlider" parent="Controls/PlatformAngle"]
margin_left = 112.0
margin_right = 312.0
margin_bottom = 16.0
rect_min_size = Vector2( 200, 0 )
max_value = 360.0
script = ExtResource( 5 )
snap_step = 5.0
[node name="LabelValue" type="Label" parent="Controls/PlatformAngle"]
margin_left = 332.0
margin_top = 1.0
margin_right = 432.0
margin_bottom = 15.0
rect_min_size = Vector2( 100, 0 )
text = "0.0"
script = ExtResource( 4 )
[node name="BodyAngle" type="HBoxContainer" parent="Controls"]
margin_top = 52.0
margin_right = 432.0
margin_bottom = 68.0
custom_constants/separation = 20
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="Controls/BodyAngle"]
margin_left = 22.0
margin_top = 1.0
margin_right = 92.0
margin_bottom = 15.0
text = "Body angle"
[node name="HSlider" type="HSlider" parent="Controls/BodyAngle"]
margin_left = 112.0
margin_right = 312.0
margin_bottom = 16.0
rect_min_size = Vector2( 200, 0 )
max_value = 360.0
script = ExtResource( 5 )
snap_step = 5.0
[node name="LabelValue" type="Label" parent="Controls/BodyAngle"]
margin_left = 332.0
margin_top = 1.0
margin_right = 432.0
margin_bottom = 15.0
rect_min_size = Vector2( 100, 0 )
text = "0.0"
script = ExtResource( 4 )
[node name="LabelResultTitle" type="Label" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = 34.1273
margin_top = 251.131
margin_right = 88.1273
margin_bottom = 265.131
text = "RESULT: "
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LabelResult" type="Label" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = 34.1273
margin_top = 266.131
margin_right = 88.1273
margin_bottom = 280.131
text = "..."
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LabelRestart" type="Label" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = 34.1273
margin_top = 304.841
margin_right = 139.127
margin_bottom = 318.841
text = "SPACE - RESTART"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Timer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true
[node name="TargetArea2D" type="Area2D" parent="."]
position = Vector2( 724, 300 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="TargetArea2D"]
shape = SubResource( 1 )
[node name="OneWayKinematicBody2D" type="KinematicBody2D" parent="."]
position = Vector2( 512, 300 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="OneWayKinematicBody2D"]
shape = SubResource( 2 )
one_way_collision = true
[node name="RigidBody2D" type="RigidBody2D" parent="."]
position = Vector2( 300, 300 )
collision_mask = 2147483649
gravity_scale = 0.0
contacts_reported = 1
contact_monitor = true
[node name="Sprite" type="Sprite" parent="RigidBody2D"]
self_modulate = Color( 1, 1, 1, 0.501961 )
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
shape = SubResource( 3 )
[node name="KinematicBody2D" type="KinematicBody2D" parent="."]
position = Vector2( 300, 300 )
collision_mask = 2147483649
[node name="Sprite" type="Sprite" parent="KinematicBody2D"]
self_modulate = Color( 1, 1, 1, 0.501961 )
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"]
shape = SubResource( 3 )
[connection signal="value_changed" from="Controls/PlatformSize/HSlider" to="." method="_set_platform_size"]
[connection signal="value_changed" from="Controls/PlatformAngle/HSlider" to="." method="_set_platform_angle"]
[connection signal="value_changed" from="Controls/BodyAngle/HSlider" to="." method="_set_rigidbody_angle"]