State machine and crosshair

This commit is contained in:
Rendo 2025-11-21 00:56:23 +05:00
commit a32ac09b04
12 changed files with 116 additions and 5 deletions

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://dpsr6ug3pkb40"]
[gd_scene load_steps=10 format=3 uid="uid://dpsr6ug3pkb40"]
[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scritps/player/player.gd" id="1_g2els"]
[ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scritps/player/crosshair.gd" id="3_dqkch"]
[ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scritps/player/player_camera.gd" id="3_qhqgy"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"]
@ -44,9 +45,6 @@ tracks/2/keys = {
"values": [Vector3(0, 2, 0), Vector3(0, 1.5, 0)]
}
[sub_resource type="Animation" id="Animation_qhqgy"]
resource_name = "Stand"
[sub_resource type="Animation" id="Animation_dqkch"]
length = 0.001
tracks/0/type = "value"
@ -86,6 +84,9 @@ tracks/2/keys = {
"values": [Vector3(0, 2, 0)]
}
[sub_resource type="Animation" id="Animation_qhqgy"]
resource_name = "Stand"
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qlg0r"]
_data = {
&"Crouch": SubResource("Animation_g2els"),
@ -125,3 +126,31 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_g2els")
debug_color = Color(0.9878064, 0, 0.31407458, 0.41960785)
debug_fill = false
[node name="HUD" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Crosshair" type="Control" parent="HUD"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("3_dqkch")
crosses_width = 2.0
crosses_length = 6.0
crosses_offset = 3.0
[node name="MovementMachine" type="Node" parent="."]