This commit is contained in:
Marek Le
2026-03-29 22:58:23 +02:00
parent b9ed399d34
commit 80a65fa555
19 changed files with 217 additions and 58 deletions

78
scenes/portal/portal.tscn Normal file
View File

@@ -0,0 +1,78 @@
[gd_scene format=3]
[ext_resource type="Script" path="res://scripts/portal/portal.gd" id="1"]
[ext_resource type="Script" path="res://scripts/components/health.gd" id="2"]
[ext_resource type="Script" path="res://scripts/components/healthbar.gd" id="3"]
[ext_resource type="Script" path="res://scripts/portal/portal_spawner.gd" id="4"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1"]
radius = 1.0
height = 2.0
[sub_resource type="CylinderShape3D" id="CylinderShape3D_2"]
radius = 1.0
height = 2.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1"]
albedo_color = Color(0.5, 0.1, 0.8, 1)
[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="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)
[node name="Portal" type="StaticBody3D"]
script = ExtResource("1")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CylinderShape3D_1")
[node name="Mesh" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_1")
[node name="Health" type="Node" parent="."]
script = ExtResource("2")
max_health = 500.0
[node name="HitArea" type="Area3D" parent="."]
collision_layer = 4
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitArea"]
shape = SubResource("CylinderShape3D_2")
[node name="PortalSpawner" type="Node" parent="."]
script = ExtResource("4")
[node name="Healthbar" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
billboard = 1
pixel_size = 0.01
script = ExtResource("3")
[node name="SubViewport" type="SubViewport" parent="Healthbar"]
transparent_bg = true
size = Vector2i(104, 15)
[node name="Border" type="ColorRect" parent="Healthbar/SubViewport"]
offset_right = 104.0
offset_bottom = 15.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 = 13.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