refactor to state machine
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://8esyynmieyog"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/runner.gd" id="1_d63rt"]
|
||||
[ext_resource type="Script" path="res://scripts/runner_input.gd" id="2_xmliy"]
|
||||
[ext_resource type="Material" uid="uid://ccrb46njti2ke" path="res://materials/runner.tres" id="3_6c0ro"]
|
||||
[ext_resource type="Script" path="res://scripts/state_machine.gd" id="4_40cmc"]
|
||||
[ext_resource type="Script" path="res://scripts/states/idle.gd" id="5_hq6tn"]
|
||||
[ext_resource type="Script" path="res://scripts/states/move.gd" id="6_1teax"]
|
||||
[ext_resource type="Script" path="res://scripts/states/fall.gd" id="7_jfat4"]
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_ukf45"]
|
||||
properties/0/path = NodePath(".:player_id")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 2
|
||||
properties/1/path = NodePath(".:server_position")
|
||||
properties/1/spawn = true
|
||||
properties/1/replication_mode = 2
|
||||
properties/2/path = NodePath(".:server_rotation")
|
||||
properties/2/spawn = true
|
||||
properties/2/replication_mode = 2
|
||||
|
||||
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_1agtp"]
|
||||
properties/0/path = NodePath("RunnerInput:move_direction")
|
||||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 2
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_wsx1k"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_j6tb3"]
|
||||
radius = 0.3
|
||||
height = 1.8
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_di3a0"]
|
||||
radius = 0.3
|
||||
height = 1.8
|
||||
|
||||
[sub_resource type="PrismMesh" id="PrismMesh_fcj1v"]
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_tudvv"]
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_1gltg"]
|
||||
|
||||
[node name="Runner" type="CharacterBody3D" node_paths=PackedStringArray("state_machine")]
|
||||
script = ExtResource("1_d63rt")
|
||||
state_machine = NodePath("StateMachine")
|
||||
|
||||
[node name="RunnerSync" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_config = SubResource("SceneReplicationConfig_ukf45")
|
||||
|
||||
[node name="RunnerInput" type="MultiplayerSynchronizer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
replication_config = SubResource("SceneReplicationConfig_1agtp")
|
||||
script = ExtResource("2_xmliy")
|
||||
|
||||
[node name="Camera" type="Camera3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="CameraPivot" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
|
||||
[node name="CameraSpringArm" type="SpringArm3D" parent="CameraPivot"]
|
||||
shape = SubResource("SphereShape3D_wsx1k")
|
||||
spring_length = 3.5
|
||||
|
||||
[node name="CameraTarget" type="Node3D" parent="CameraPivot/CameraSpringArm"]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
||||
|
||||
[node name="Collider" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("CapsuleShape3D_j6tb3")
|
||||
|
||||
[node name="Skin" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="MainBody" type="MeshInstance3D" parent="Skin"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_di3a0")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = ExtResource("3_6c0ro")
|
||||
|
||||
[node name="Beak" type="MeshInstance3D" parent="Skin/MainBody"]
|
||||
transform = Transform3D(0.35, 0, 0, 0, -1.09278e-08, 0.1, 0, -0.25, -4.37114e-09, 0, 0.65, -0.3)
|
||||
visible = false
|
||||
mesh = SubResource("PrismMesh_fcj1v")
|
||||
surface_material_override/0 = ExtResource("3_6c0ro")
|
||||
|
||||
[node name="RightEye" type="MeshInstance3D" parent="Skin/MainBody"]
|
||||
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0.1, 0.6, -0.25)
|
||||
mesh = SubResource("SphereMesh_tudvv")
|
||||
|
||||
[node name="LeftEye" type="MeshInstance3D" parent="Skin/MainBody"]
|
||||
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, -0.1, 0.6, -0.25)
|
||||
mesh = SubResource("SphereMesh_1gltg")
|
||||
|
||||
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("current_state")]
|
||||
script = ExtResource("4_40cmc")
|
||||
current_state = NodePath("Idle")
|
||||
|
||||
[node name="Idle" type="Node" parent="StateMachine" node_paths=PackedStringArray("move_state")]
|
||||
script = ExtResource("5_hq6tn")
|
||||
move_state = NodePath("../Move")
|
||||
|
||||
[node name="Move" type="Node" parent="StateMachine" node_paths=PackedStringArray("idle_state", "fall_state")]
|
||||
script = ExtResource("6_1teax")
|
||||
idle_state = NodePath("../Idle")
|
||||
fall_state = NodePath("../Fall")
|
||||
|
||||
[node name="Fall" type="Node" parent="StateMachine" node_paths=PackedStringArray("move_state", "idle_state")]
|
||||
script = ExtResource("7_jfat4")
|
||||
move_state = NodePath("../Move")
|
||||
idle_state = NodePath("../Idle")
|
||||
Reference in New Issue
Block a user