This commit is contained in:
Marek Lenczewski
2026-03-30 22:56:58 +02:00
parent d6715e9c3f
commit 04749104a0
49 changed files with 1406 additions and 171 deletions

157
scenes/dungeon/dungeon.tscn Normal file
View File

@@ -0,0 +1,157 @@
[gd_scene format=3]
[ext_resource type="PackedScene" path="res://scenes/player/player.tscn" id="player"]
[ext_resource type="PackedScene" path="res://scenes/hud/hud.tscn" id="hud"]
[ext_resource type="PackedScene" path="res://scenes/enemy/enemy.tscn" id="enemy"]
[ext_resource type="PackedScene" path="res://scenes/enemy/boss.tscn" id="boss"]
[ext_resource type="Script" path="res://scripts/dungeon/dungeon_manager.gd" id="dungeon_manager"]
[ext_resource type="PackedScene" path="res://scenes/portal/gate.tscn" id="gate"]
[sub_resource type="NavigationMesh" id="NavigationMesh_1"]
vertices = PackedVector3Array(-7.0, 0.5, -7.0, -7.0, 0.5, 87.0, 7.0, 0.5, 87.0, 7.0, 0.5, -7.0)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_floor"]
albedo_color = Color(0.2, 0.18, 0.15, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_1"]
material = SubResource("StandardMaterial3D_floor")
size = Vector2(15, 90)
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_1"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wall"]
albedo_color = Color(0.25, 0.22, 0.2, 1)
[sub_resource type="BoxMesh" id="BoxMesh_north_south"]
material = SubResource("StandardMaterial3D_wall")
size = Vector3(15, 3, 0.5)
[sub_resource type="BoxShape3D" id="BoxShape3D_north_south"]
size = Vector3(15, 3, 0.5)
[sub_resource type="BoxMesh" id="BoxMesh_east_west"]
material = SubResource("StandardMaterial3D_wall")
size = Vector3(0.5, 3, 90)
[sub_resource type="BoxShape3D" id="BoxShape3D_east_west"]
size = Vector3(0.5, 3, 90)
[node name="Dungeon" type="Node3D"]
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
navigation_mesh = SubResource("NavigationMesh_1")
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 40)
mesh = SubResource("PlaneMesh_1")
[node name="BodenCollision" type="StaticBody3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision"]
shape = SubResource("WorldBoundaryShape3D_1")
[node name="WallSouth" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -5.25)
[node name="Mesh" type="MeshInstance3D" parent="WallSouth"]
mesh = SubResource("BoxMesh_north_south")
[node name="CollisionShape3D" type="CollisionShape3D" parent="WallSouth"]
shape = SubResource("BoxShape3D_north_south")
[node name="WallNorth" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 85.25)
[node name="Mesh" type="MeshInstance3D" parent="WallNorth"]
mesh = SubResource("BoxMesh_north_south")
[node name="CollisionShape3D" type="CollisionShape3D" parent="WallNorth"]
shape = SubResource("BoxShape3D_north_south")
[node name="WallEast" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.75, 1.5, 40)
[node name="Mesh" type="MeshInstance3D" parent="WallEast"]
mesh = SubResource("BoxMesh_east_west")
[node name="CollisionShape3D" type="CollisionShape3D" parent="WallEast"]
shape = SubResource("BoxShape3D_east_west")
[node name="WallWest" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.75, 1.5, 40)
[node name="Mesh" type="MeshInstance3D" parent="WallWest"]
mesh = SubResource("BoxMesh_east_west")
[node name="CollisionShape3D" type="CollisionShape3D" parent="WallWest"]
shape = SubResource("BoxShape3D_east_west")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707, 0.707, 0, -0.707, 0.707, 0, 10, 40)
light_energy = 0.6
shadow_enabled = true
[node name="Player" parent="." instance=ExtResource("player")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -3)
[node name="HUD" parent="." instance=ExtResource("hud")]
[node name="Enemy1a" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 15)
[node name="Enemy1b" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 15)
[node name="Enemy1c" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 15)
[node name="Enemy1d" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 15)
[node name="Enemy2a" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 30)
[node name="Enemy2b" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 30)
[node name="Enemy2c" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 30)
[node name="Enemy2d" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 30)
[node name="Enemy3a" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 45)
[node name="Enemy3b" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 45)
[node name="Enemy3c" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 45)
[node name="Enemy3d" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 45)
[node name="Enemy4a" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 60)
[node name="Enemy4b" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 60)
[node name="Enemy4c" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 60)
[node name="Enemy4d" parent="." instance=ExtResource("enemy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 60)
[node name="Boss" parent="." instance=ExtResource("boss")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 75)
[node name="ExitGate" parent="." instance=ExtResource("gate")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -4)
target_scene = "res://scenes/world.tscn"
is_exit = true
[node name="DungeonManager" type="Node" parent="."]
script = ExtResource("dungeon_manager")

128
scenes/enemy/boss.tscn Normal file
View File

@@ -0,0 +1,128 @@
[gd_scene load_steps=6 format=3]
[ext_resource type="Script" path="res://scripts/enemy/boss.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/components/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"]
[ext_resource type="Script" path="res://scripts/enemy/enemy_aggro.gd" id="7"]
[ext_resource type="Resource" path="res://resources/stats/boss_stats.tres" id="8"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1"]
radius = 0.6
height = 2.0
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_2"]
radius = 0.6
height = 2.0
[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_health_fill_aggro"]
bg_color = Color(0.2, 0.4, 0.9, 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.6, 0.1, 0.6, 1)
[sub_resource type="SphereMesh" id="SphereMesh_1"]
radius = 0.75
height = 1.5
material = SubResource("StandardMaterial3D_1")
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
radius = 8.0
[node name="Boss" type="CharacterBody3D"]
script = ExtResource("1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_1")
[node name="Mesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0)
mesh = SubResource("SphereMesh_1")
[node name="Health" type="Node" parent="."]
script = ExtResource("2")
stats = ExtResource("8")
[node name="Shield" type="Node" parent="."]
script = ExtResource("3")
stats = ExtResource("8")
[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="EnemyAggro" type="Node" parent="."]
script = ExtResource("7")
[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, 2.0, 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 = 500.0
value = 500.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 = 100.0
value = 100.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"]

View File

@@ -48,6 +48,18 @@ max_value = 100.0
value = 100.0
show_percentage = false
[node name="HealthLabel" type="Label" parent="HealthBar"]
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 = 12
text = "100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ShieldBar" type="ProgressBar" parent="."]
offset_left = 10.0
offset_top = 35.0
@@ -59,6 +71,18 @@ max_value = 50.0
value = 50.0
show_percentage = false
[node name="ShieldLabel" type="Label" parent="ShieldBar"]
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 = 12
text = "50/50"
horizontal_alignment = 1
vertical_alignment = 1
[node name="RespawnTimer" type="Label" parent="."]
anchors_preset = 8
anchor_left = 0.5

36
scenes/portal/gate.tscn Normal file
View File

@@ -0,0 +1,36 @@
[gd_scene format=3]
[ext_resource type="Script" path="res://scripts/portal/gate.gd" id="1"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
albedo_color = Color(0.1, 0.9, 0.3, 1)
emission_enabled = true
emission = Color(0.1, 0.9, 0.3, 1)
emission_energy_multiplier = 0.5
[sub_resource type="CylinderMesh" id="CylinderMesh_1"]
top_radius = 1.0
bottom_radius = 1.0
height = 2.0
material = SubResource("StandardMaterial3D_1")
[sub_resource type="SphereShape3D" id="SphereShape3D_1"]
radius = 3.0
[node name="Gate" type="StaticBody3D"]
script = ExtResource("1")
collision_layer = 0
collision_mask = 0
[node name="Mesh" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_1")
[node name="GateArea" type="Area3D" parent="."]
collision_layer = 0
collision_mask = 1
monitoring = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="GateArea"]
shape = SubResource("SphereShape3D_1")
[connection signal="body_entered" from="GateArea" to="." method="_on_gate_area_body_entered"]

View File

@@ -2,10 +2,10 @@
[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"]
[ext_resource type="PackedScene" path="res://scenes/portal/portal.tscn" id="portal"]
[ext_resource type="Script" uid="uid://cskx6o07iukwh" path="res://scripts/world/portal_spawner.gd" id="portal_spawner"]
[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)
vertices = PackedVector3Array(-49.5, 0.5, -49.5, -49.5, 0.5, 49.5, 49.5, 0.5, 49.5, 49.5, 0.5, -49.5)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="Gradient" id="Gradient_1"]
@@ -19,37 +19,56 @@ noise = SubResource("FastNoiseLite_1")
color_ramp = SubResource("Gradient_1")
seamless = true
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ground"]
albedo_texture = SubResource("NoiseTexture2D_1")
uv1_scale = Vector3(3, 3, 1)
uv1_scale = Vector3(15, 15, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_1"]
material = SubResource("StandardMaterial3D_1")
size = Vector2(20, 20)
material = SubResource("StandardMaterial3D_ground")
size = Vector2(100, 100)
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_1"]
[node name="World" type="Node3D" unique_id=1834775183]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tavern"]
albedo_color = Color(0.45, 0.3, 0.15, 1)
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=561649622]
[sub_resource type="BoxMesh" id="BoxMesh_tavern"]
material = SubResource("StandardMaterial3D_tavern")
size = Vector3(5, 3, 5)
[sub_resource type="BoxShape3D" id="BoxShape3D_tavern"]
size = Vector3(5, 3, 5)
[node name="World" type="Node3D" unique_id=1865233338]
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=1265843679]
navigation_mesh = SubResource("NavigationMesh_1")
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=1129907783]
[node name="Boden" type="MeshInstance3D" parent="NavigationRegion3D" unique_id=593226019]
mesh = SubResource("PlaneMesh_1")
[node name="BodenCollision" type="StaticBody3D" parent="." unique_id=391155617]
[node name="BodenCollision" type="StaticBody3D" parent="." unique_id=1112667638]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision" unique_id=809444866]
[node name="CollisionShape3D" type="CollisionShape3D" parent="BodenCollision" unique_id=621554623]
shape = SubResource("WorldBoundaryShape3D_1")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1132129079]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=1797472817]
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="Taverne" type="StaticBody3D" parent="." unique_id=1978646562]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
[node name="HUD" parent="." unique_id=24362518 instance=ExtResource("hud")]
[node name="Mesh" type="MeshInstance3D" parent="Taverne" unique_id=2043279810]
mesh = SubResource("BoxMesh_tavern")
[node name="Portal" parent="." unique_id=2086501116 instance=ExtResource("portal")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, 5)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Taverne" unique_id=2108564286]
shape = SubResource("BoxShape3D_tavern")
[node name="Player" parent="." unique_id=585018813 instance=ExtResource("player")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -5)
[node name="HUD" parent="." unique_id=763693646 instance=ExtResource("hud")]
[node name="PortalSpawner" type="Node" parent="." unique_id=2100621428]
script = ExtResource("portal_spawner")