87 lines
3.5 KiB
Plaintext
87 lines
3.5 KiB
Plaintext
[gd_scene load_steps=9 format=3 uid="uid://ul8o2n823qod"]
|
|
|
|
[ext_resource type="Script" path="res://content/scripts/player.gd" id="1_i6r2s"]
|
|
[ext_resource type="Script" path="res://content/scripts/smoother.gd" id="2_dpu6i"]
|
|
[ext_resource type="Script" path="res://content/scripts/dampened_camera.gd" id="3_24qwg"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="4_erffw"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="5_mmqqh"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_8xdrw"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_525mu"]
|
|
|
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tpgoe"]
|
|
height = 1.8
|
|
radius = 0.25
|
|
|
|
[node name="Player" type="StaticBody3D" node_paths=PackedStringArray("head", "body", "camera", "collision_shape", "state_chart")]
|
|
script = ExtResource("1_i6r2s")
|
|
max_speed = 6
|
|
slope_limit = 40.0
|
|
step_height = 0.3
|
|
snap_to_ground_distance = 0.3
|
|
head = NodePath("Body/Head")
|
|
body = NodePath("Body")
|
|
camera = NodePath("Body/Head/Smoother/Camera3D")
|
|
collision_shape = NodePath("MoveCollider")
|
|
state_chart = NodePath("StateChart")
|
|
|
|
[node name="MoveCollider" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
|
|
shape = SubResource("CylinderShape3D_tpgoe")
|
|
|
|
[node name="Body" type="Node3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
|
|
|
[node name="Head" type="Node3D" parent="Body"]
|
|
|
|
[node name="Smoother" type="Node3D" parent="Body/Head" node_paths=PackedStringArray("target")]
|
|
script = ExtResource("2_dpu6i")
|
|
target = NodePath("..")
|
|
|
|
[node name="Camera3D" type="Camera3D" parent="Body/Head/Smoother" node_paths=PackedStringArray("target")]
|
|
script = ExtResource("3_24qwg")
|
|
target = NodePath("..")
|
|
|
|
[node name="StateChart" type="Node" parent="."]
|
|
script = ExtResource("4_erffw")
|
|
|
|
[node name="Root" type="Node" parent="StateChart"]
|
|
script = ExtResource("5_mmqqh")
|
|
initial_state = NodePath("Grounded")
|
|
|
|
[node name="Grounded" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("6_8xdrw")
|
|
|
|
[node name="On Jump" type="Node" parent="StateChart/Root/Grounded"]
|
|
script = ExtResource("7_525mu")
|
|
to = NodePath("../../Airborne/Jumping")
|
|
event = &"Jump"
|
|
|
|
[node name="On Airborne" type="Node" parent="StateChart/Root/Grounded"]
|
|
script = ExtResource("7_525mu")
|
|
to = NodePath("../../Airborne/Falling")
|
|
event = &"Airborne"
|
|
|
|
[node name="Airborne" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("5_mmqqh")
|
|
initial_state = NodePath("Jumping")
|
|
|
|
[node name="On Grounded" type="Node" parent="StateChart/Root/Airborne"]
|
|
script = ExtResource("7_525mu")
|
|
to = NodePath("../../Grounded")
|
|
event = &"Grounded"
|
|
|
|
[node name="Jumping" type="Node" parent="StateChart/Root/Airborne"]
|
|
script = ExtResource("6_8xdrw")
|
|
|
|
[node name="On Airborne" type="Node" parent="StateChart/Root/Airborne/Jumping"]
|
|
script = ExtResource("7_525mu")
|
|
to = NodePath("../../Falling")
|
|
event = &"Airborne"
|
|
|
|
[node name="Falling" type="Node" parent="StateChart/Root/Airborne"]
|
|
script = ExtResource("6_8xdrw")
|
|
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Grounded" to="." method="_on_grounded_state_physics_processing"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/Jumping" to="." method="_on_jumping_state_physics_processing"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/Falling" to="." method="_on_falling_state_physics_processing"]
|