159 lines
5.8 KiB
Text
159 lines
5.8 KiB
Text
[gd_scene load_steps=14 format=3 uid="uid://cybm74xwbsivx"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://3i17aqnrspma" path="res://assets/textures/player/canny.png" id="1_cp4br"]
|
|
[ext_resource type="Script" path="res://objects/canny_cat.gd" id="1_twfq8"]
|
|
[ext_resource type="Texture2D" uid="uid://bqg7vd5r7w8tm" path="res://assets/textures/shadow.png" id="2_fwt6m"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="4_n67yk"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="5_ox6hb"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="6_bu01i"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="7_epv8h"]
|
|
[ext_resource type="Script" path="res://addons/godot_state_charts/expression_guard.gd" id="8_d5slg"]
|
|
|
|
[sub_resource type="SphereShape3D" id="SphereShape3D_4o01j"]
|
|
radius = 0.45
|
|
|
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2xpb7"]
|
|
shading_mode = 0
|
|
albedo_color = Color(0.916968, 0.113727, 0, 1)
|
|
|
|
[sub_resource type="CylinderMesh" id="CylinderMesh_b16dl"]
|
|
top_radius = 0.05
|
|
bottom_radius = 0.05
|
|
height = 4.0
|
|
radial_segments = 4
|
|
rings = 0
|
|
|
|
[sub_resource type="Resource" id="Resource_ej40h"]
|
|
script = ExtResource("8_d5slg")
|
|
expression = "not velocity.is_zero_approx()"
|
|
|
|
[sub_resource type="Resource" id="Resource_637i1"]
|
|
resource_name = "Not Moving"
|
|
script = ExtResource("8_d5slg")
|
|
expression = "velocity.is_zero_approx()"
|
|
|
|
[node name="CannyCat" type="CharacterBody3D" node_paths=PackedStringArray("state_chart", "graphics", "power_indicator", "camera_arm", "collision_shape")]
|
|
process_priority = -100
|
|
process_physics_priority = -100
|
|
collision_layer = 16
|
|
collision_mask = 3
|
|
axis_lock_angular_x = true
|
|
axis_lock_angular_y = true
|
|
axis_lock_angular_z = true
|
|
script = ExtResource("1_twfq8")
|
|
power_scale = 20.0
|
|
power_sensitivity = 0.01
|
|
power_threshold = 0.2
|
|
gravity = 10.0
|
|
friction = 10.0
|
|
friction_coef = 0.01
|
|
friction_pow = 60.0
|
|
stop_threshold = 0.1
|
|
camera_low_angle = 0.349066
|
|
camera_high_angle = 1.0472
|
|
camera_yaw_sensitivity = 0.00872665
|
|
camera_pitch_sensitivity = 0.00872665
|
|
state_chart = NodePath("StateChart")
|
|
graphics = NodePath("Graphics")
|
|
power_indicator = NodePath("PowerIndicator")
|
|
camera_arm = NodePath("CameraArm")
|
|
collision_shape = NodePath("CollisionShape3D")
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
|
shape = SubResource("SphereShape3D_4o01j")
|
|
|
|
[node name="Graphics" type="Node3D" parent="."]
|
|
|
|
[node name="CannySprite" type="Sprite3D" parent="Graphics"]
|
|
pixel_size = 0.0156
|
|
billboard = 1
|
|
texture_filter = 0
|
|
texture = ExtResource("1_cp4br")
|
|
|
|
[node name="ShadowArm" type="SpringArm3D" parent="Graphics"]
|
|
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.25, 0)
|
|
collision_mask = 7
|
|
spring_length = 100.0
|
|
|
|
[node name="ShadowSprite" type="Sprite3D" parent="Graphics/ShadowArm"]
|
|
pixel_size = 0.0313
|
|
texture = ExtResource("2_fwt6m")
|
|
|
|
[node name="PowerIndicator" type="Node3D" parent="."]
|
|
visible = false
|
|
|
|
[node name="Line" type="MeshInstance3D" parent="PowerIndicator"]
|
|
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 2)
|
|
material_override = SubResource("StandardMaterial3D_2xpb7")
|
|
cast_shadow = 0
|
|
gi_mode = 0
|
|
mesh = SubResource("CylinderMesh_b16dl")
|
|
|
|
[node name="CameraArm" type="SpringArm3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 0, 0)
|
|
spring_length = 8.0
|
|
|
|
[node name="Camera3D" type="Camera3D" parent="CameraArm"]
|
|
current = true
|
|
|
|
[node name="StateChart" type="Node" parent="."]
|
|
script = ExtResource("4_n67yk")
|
|
track_in_editor = true
|
|
initial_expression_properties = {
|
|
"velocity": Vector3(0, 0, 0)
|
|
}
|
|
|
|
[node name="Root" type="Node" parent="StateChart"]
|
|
script = ExtResource("5_ox6hb")
|
|
initial_state = NodePath("Moving")
|
|
|
|
[node name="on GoalEntered" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("7_epv8h")
|
|
to = NodePath("../Winning")
|
|
event = &"goal_entered"
|
|
delay_in_seconds = "0.0"
|
|
|
|
[node name="Idle" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("6_bu01i")
|
|
|
|
[node name="on ChargePressed" type="Node" parent="StateChart/Root/Idle"]
|
|
script = ExtResource("7_epv8h")
|
|
to = NodePath("../../Charging")
|
|
event = &"charge_pressed"
|
|
delay_in_seconds = "0.0"
|
|
|
|
[node name="when Moving" type="Node" parent="StateChart/Root/Idle"]
|
|
script = ExtResource("7_epv8h")
|
|
to = NodePath("../../Moving")
|
|
guard = SubResource("Resource_ej40h")
|
|
delay_in_seconds = "0.0"
|
|
|
|
[node name="Moving" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("6_bu01i")
|
|
|
|
[node name="when Stopped" type="Node" parent="StateChart/Root/Moving"]
|
|
script = ExtResource("7_epv8h")
|
|
to = NodePath("../../Idle")
|
|
guard = SubResource("Resource_637i1")
|
|
delay_in_seconds = "0.0"
|
|
|
|
[node name="Charging" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("6_bu01i")
|
|
|
|
[node name="on ChargeReleased" type="Node" parent="StateChart/Root/Charging"]
|
|
script = ExtResource("7_epv8h")
|
|
to = NodePath("../../Moving")
|
|
event = &"charge_released"
|
|
delay_in_seconds = "0.0"
|
|
|
|
[node name="Winning" type="Node" parent="StateChart/Root"]
|
|
script = ExtResource("6_bu01i")
|
|
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Idle" to="." method="_apply_gravity"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_slow_to_stop"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_apply_gravity"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Moving" to="." method="_bounce_on_walls"]
|
|
[connection signal="state_entered" from="StateChart/Root/Charging" to="." method="_start_charge"]
|
|
[connection signal="state_exited" from="StateChart/Root/Charging" to="." method="_end_charge"]
|
|
[connection signal="state_physics_processing" from="StateChart/Root/Charging" to="." method="_update_charge"]
|
|
[connection signal="state_entered" from="StateChart/Root/Winning" to="." method="_start_winning"]
|