last init

This commit is contained in:
Marek
2026-03-29 16:05:31 +02:00
commit aa2c182534
53 changed files with 1419 additions and 0 deletions

117
scenes/enemy/enemy.tscn Normal file
View File

@@ -0,0 +1,117 @@
[gd_scene load_steps=6 format=3]
[ext_resource type="Script" path="res://scripts/enemy/enemy.gd" id="1"]
[ext_resource type="Script" path="res://scripts/components/health.gd" id="2"]
[ext_resource type="Script" path="res://scripts/components/shield.gd" id="3"]
[ext_resource type="Script" path="res://scripts/enemy/enemy_healthbar.gd" id="4"]
[ext_resource type="Script" path="res://scripts/enemy/enemy_movement.gd" id="5"]
[ext_resource type="Script" path="res://scripts/enemy/enemy_combat.gd" id="6"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
radius = 0.4
height = 1.5
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2"]
radius = 0.4
height = 1.5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_bg"]
bg_color = Color(0.3, 0.1, 0.1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_fill"]
bg_color = Color(0.2, 0.8, 0.2, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_bg"]
bg_color = Color(0.1, 0.1, 0.3, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_fill"]
bg_color = Color(0.2, 0.5, 0.9, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
albedo_color = Color(0.8, 0.1, 0.1, 1)
[sub_resource type="SphereMesh" id="SphereMesh_1"]
radius = 0.5
height = 1.0
material = SubResource("StandardMaterial3D_1")
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
radius = 8.0
[node name="Enemy" type="CharacterBody3D"]
script = ExtResource("1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_1")
[node name="Mesh" type="MeshInstance3D" parent="."]
mesh = SubResource("SphereMesh_1")
[node name="Health" type="Node" parent="."]
script = ExtResource("2")
[node name="Shield" type="Node" parent="."]
script = ExtResource("3")
[node name="HitArea" type="Area3D" parent="."]
collision_layer = 4
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea"]
shape = SubResource("CapsuleShape3D_2")
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
[node name="EnemyMovement" type="Node" parent="."]
script = ExtResource("5")
[node name="EnemyCombat" type="Node" parent="."]
script = ExtResource("6")
[node name="DetectionArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 1
monitoring = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="DetectionArea"]
shape = SubResource("SphereShape3D_1")
[node name="Healthbar" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
billboard = 1
pixel_size = 0.01
script = ExtResource("4")
[node name="SubViewport" type="SubViewport" parent="Healthbar"]
transparent_bg = true
size = Vector2i(104, 29)
[node name="Border" type="ColorRect" parent="Healthbar/SubViewport"]
offset_right = 104.0
offset_bottom = 29.0
color = Color(1, 0.9, 0.2, 1)
[node name="HealthBar" type="ProgressBar" parent="Healthbar/SubViewport"]
offset_left = 2.0
offset_top = 2.0
offset_right = 102.0
offset_bottom = 12.0
theme_override_styles/background = SubResource("StyleBoxFlat_health_bg")
theme_override_styles/fill = SubResource("StyleBoxFlat_health_fill")
max_value = 100.0
value = 100.0
show_percentage = false
[node name="ShieldBar" type="ProgressBar" parent="Healthbar/SubViewport"]
offset_left = 2.0
offset_top = 15.0
offset_right = 102.0
offset_bottom = 27.0
theme_override_styles/background = SubResource("StyleBoxFlat_shield_bg")
theme_override_styles/fill = SubResource("StyleBoxFlat_shield_fill")
max_value = 50.0
value = 50.0
show_percentage = false
[connection signal="body_entered" from="DetectionArea" to="." method="_on_detection_area_body_entered"]
[connection signal="body_exited" from="DetectionArea" to="." method="_on_detection_area_body_exited"]

181
scenes/hud/hud.tscn Normal file
View File

@@ -0,0 +1,181 @@
[gd_scene format=3]
[ext_resource type="Script" path="res://scripts/player/hud.gd" id="1"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ability_active"]
bg_color = Color(0.2, 0.2, 0.2, 0.8)
border_width_bottom = 2
border_width_left = 2
border_width_right = 2
border_width_top = 2
border_color = Color(0.8, 0.8, 0.8, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ability_round"]
bg_color = Color(0.2, 0.2, 0.2, 0.8)
border_width_bottom = 2
border_width_left = 2
border_width_right = 2
border_width_top = 2
border_color = Color(0.8, 0.8, 0.8, 1)
corner_radius_top_left = 22
corner_radius_top_right = 22
corner_radius_bottom_right = 22
corner_radius_bottom_left = 22
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_bg"]
bg_color = Color(0.3, 0.1, 0.1, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_health_fill"]
bg_color = Color(0.2, 0.8, 0.2, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_bg"]
bg_color = Color(0.1, 0.1, 0.3, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_shield_fill"]
bg_color = Color(0.2, 0.5, 0.9, 1)
[node name="HUD" type="CanvasLayer"]
script = ExtResource("1")
[node name="HealthBar" type="ProgressBar" parent="."]
offset_left = 10.0
offset_top = 10.0
offset_right = 210.0
offset_bottom = 30.0
theme_override_styles/background = SubResource("StyleBoxFlat_health_bg")
theme_override_styles/fill = SubResource("StyleBoxFlat_health_fill")
max_value = 100.0
value = 100.0
show_percentage = false
[node name="ShieldBar" type="ProgressBar" parent="."]
offset_left = 10.0
offset_top = 35.0
offset_right = 210.0
offset_bottom = 55.0
theme_override_styles/background = SubResource("StyleBoxFlat_shield_bg")
theme_override_styles/fill = SubResource("StyleBoxFlat_shield_fill")
max_value = 50.0
value = 50.0
show_percentage = false
[node name="RespawnTimer" type="Label" parent="."]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -50.0
offset_top = -30.0
offset_right = 50.0
offset_bottom = 30.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 48
horizontal_alignment = 1
vertical_alignment = 1
[node name="AbilityBar" type="HBoxContainer" parent="."]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -130.0
offset_top = -60.0
offset_right = 130.0
offset_bottom = -10.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/separation = 5
[node name="ClassIcon" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_round")
[node name="Label" type="Label" parent="AbilityBar/ClassIcon"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 20
text = "D"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Ability1" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_active")
[node name="Label" type="Label" parent="AbilityBar/Ability1"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Ability2" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_active")
[node name="Label" type="Label" parent="AbilityBar/Ability2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Ability3" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_active")
[node name="Label" type="Label" parent="AbilityBar/Ability3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "3"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Ability4" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_active")
[node name="Label" type="Label" parent="AbilityBar/Ability4"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "4"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Ability5" type="Panel" parent="AbilityBar"]
custom_minimum_size = Vector2(45, 45)
theme_override_styles/panel = SubResource("StyleBoxFlat_ability_round")
[node name="Label" type="Label" parent="AbilityBar/Ability5"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "P"
horizontal_alignment = 1
vertical_alignment = 1

62
scenes/player/player.tscn Normal file
View File

@@ -0,0 +1,62 @@
[gd_scene format=3 uid="uid://cdnkbt1f0db7e"]
[ext_resource type="Script" uid="uid://bfpt2p7uucfyb" path="res://scripts/player/player.gd" id="1"]
[ext_resource type="Script" uid="uid://cohjyjge1kqxb" path="res://scripts/player/camera.gd" id="2"]
[ext_resource type="Script" uid="uid://fg87dh8fbc8" path="res://scripts/player/movement.gd" id="3"]
[ext_resource type="Script" uid="uid://d15til6fsxw5b" path="res://scripts/player/combat.gd" id="4"]
[ext_resource type="Script" path="res://scripts/components/health.gd" id="5"]
[ext_resource type="Script" path="res://scripts/components/shield.gd" id="6"]
[ext_resource type="Script" path="res://scripts/player/targeting.gd" id="8"]
[ext_resource type="Script" path="res://scripts/player/respawn.gd" id="9"]
[ext_resource type="Script" path="res://scripts/player/player_class.gd" id="10"]
[ext_resource type="Resource" path="res://resources/ability_sets/tank_set.tres" id="11"]
[ext_resource type="Resource" path="res://resources/ability_sets/damage_set.tres" id="12"]
[ext_resource type="Resource" path="res://resources/ability_sets/healer_set.tres" id="13"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
radius = 0.3
height = 1.8
[sub_resource type="CapsuleMesh" id="CapsuleMesh_1"]
radius = 0.3
height = 1.8
[node name="Player" type="CharacterBody3D" unique_id=1350215040]
script = ExtResource("1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=33887999]
shape = SubResource("CapsuleShape3D_1")
[node name="Mesh" type="MeshInstance3D" parent="." unique_id=1346931672]
mesh = SubResource("CapsuleMesh_1")
[node name="CameraPivot" type="Node3D" parent="." unique_id=1292689540]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
script = ExtResource("2")
[node name="Camera3D" type="Camera3D" parent="CameraPivot" unique_id=1225820651]
transform = Transform3D(1, 0, 0, 0, 0.966, 0.259, 0, -0.259, 0.966, 0, 2, 5)
[node name="Movement" type="Node" parent="." unique_id=654979387]
script = ExtResource("3")
[node name="Combat" type="Node" parent="." unique_id=1754235583]
script = ExtResource("4")
[node name="Targeting" type="Node" parent="."]
script = ExtResource("8")
[node name="Health" type="Node" parent="."]
script = ExtResource("5")
[node name="Shield" type="Node" parent="."]
script = ExtResource("6")
[node name="Respawn" type="Node" parent="."]
script = ExtResource("9")
[node name="PlayerClass" type="Node" parent="."]
script = ExtResource("10")
tank_set = ExtResource("11")
damage_set = ExtResource("12")
healer_set = ExtResource("13")

64
scenes/world.tscn Normal file
View File

@@ -0,0 +1,64 @@
[gd_scene format=3 uid="uid://dy1icabu2ssbw"]
[ext_resource type="PackedScene" path="res://scenes/enemy/enemy.tscn" id="enemy"]
[ext_resource type="PackedScene" path="res://scenes/hud/hud.tscn" id="hud"]
[ext_resource type="PackedScene" uid="uid://cdnkbt1f0db7e" path="res://scenes/player/player.tscn" id="player"]
[sub_resource type="NavigationMesh" id="NavigationMesh_1"]
vertices = PackedVector3Array(-9.5, 0.5, -9.5, -9.5, 0.5, 9.5, 9.5, 0.5, 9.5, 9.5, 0.5, -9.5)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="Gradient" id="Gradient_1"]
colors = PackedColorArray(0.15, 0.35, 0.05, 1, 0.3, 0.55, 0.1, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_1"]
frequency = 0.05
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_1"]
noise = SubResource("FastNoiseLite_1")
color_ramp = SubResource("Gradient_1")
seamless = true
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
albedo_texture = SubResource("NoiseTexture2D_1")
uv1_scale = Vector3(3, 3, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_1"]
material = SubResource("StandardMaterial3D_1")
size = Vector2(20, 20)
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_1"]
[node name="World" type="Node3D" unique_id=1834775183]
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=561649622]
navigation_mesh = SubResource("NavigationMesh_1")
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=1129907783]
mesh = SubResource("PlaneMesh_1")
[node name="BodenCollision" type="StaticBody3D" parent="." unique_id=391155617]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision" unique_id=809444866]
shape = SubResource("WorldBoundaryShape3D_1")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1132129079]
transform = Transform3D(1, 0, 0, 0, 0.707, 0.707, 0, -0.707, 0.707, 0, 10, 0)
shadow_enabled = true
[node name="Player" parent="." unique_id=190642073 instance=ExtResource("player")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 1, -7)
[node name="HUD" parent="." unique_id=24362518 instance=ExtResource("hud")]
[node name="Enemy1" parent="." unique_id=1152011787 instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0.75, 5)
[node name="Enemy2" parent="." unique_id=877649363 instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7, 0.75, 5)
[node name="Enemy3" parent="." unique_id=1831736748 instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0.75, 7)
[node name="Enemy4" parent="." unique_id=1818643429 instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7, 0.75, 7)