Mejora de combate con boss

This commit is contained in:
Diego De la Viuda Llorente committed 2026-11-10 17:36:15 +01:00
1 parent f414d43a37
commit d983bc2e69
11 files changed
+1076 -77

No files matched your search

+10 -3
View File
@@ -7,7 +7,7 @@ var _boss_defeated: bool = false
@onready var gate: StaticBody2D = $Gate
@onready var gate_shape: CollisionShape2D = $Gate/CollisionShape2D
@onready var gate_visual: Polygon2D = $Gate/Visual
@onready var gate_visual: OssuaryGateVisual = $Gate/Visual
@onready var notice: Label = $GateMessage/Text
@onready var boss: Node2D = $Boss
@@ -18,6 +18,7 @@ func _ready() -> void:
remaining += 1
enemy.connect("died", _on_enemy_died)
boss.connect("died", _on_boss_died)
gate_visual.fully_open.connect(_on_gate_fully_opened)
$GateSensor.body_entered.connect(_on_gate_approach)
$GateSensor.body_exited.connect(_on_gate_depart)
_update_gate()
@@ -28,13 +29,19 @@ func _on_enemy_died() -> void:
func _update_gate() -> void:
_gate_open = remaining == 0
gate_shape.set_deferred("disabled", _gate_open)
gate_visual.visible = not _gate_open
gate_visual.set_unlocked(_gate_open)
if not _gate_open:
gate_shape.set_deferred("disabled", false)
if _gate_open:
notice.text = "TODOS DERROTADOS. EL SELLO SE HA ROTO."
else:
notice.text = LOCKED_TEXT
func _on_gate_fully_opened() -> void:
# La colision no desaparece hasta terminar de abrirse visualmente.
gate_shape.set_deferred("disabled", true)
func _on_gate_approach(body: Node2D) -> void:
if body.is_in_group("player"):
$GateMessage.visible = true
+3 -3
View File
@@ -2,6 +2,7 @@
[ext_resource type="Script" path="res://levels/level_02.gd" id="level"]
[ext_resource type="Script" path="res://levels/level_02_art.gd" id="art"]
[ext_resource type="Script" path="res://world/triggers/ossuary_gate_visual.gd" id="gate_art"]
[ext_resource type="PackedScene" path="res://player/player.tscn" id="player"]
[ext_resource type="PackedScene" path="res://ui/mobile_controls/mobile_controls.tscn" id="mobile"]
[ext_resource type="PackedScene" path="res://world/terrain/ground.tscn" id="ground"]
@@ -160,9 +161,8 @@ collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Gate"]
shape = SubResource("gate_collision")
[node name="Visual" type="Polygon2D" parent="Gate"]
color = Color(0.72, 0.17, 0.30, 0.92)
polygon = PackedVector2Array(-22, -110, 22, -110, 22, 110, -22, 110)
[node name="Visual" type="Node2D" parent="Gate"]
script = ExtResource("gate_art")
[node name="GateSensor" type="Area2D" parent="."]
position = Vector2(3030, 600)
-3
View File
@@ -20,9 +20,6 @@ func _draw() -> void:
for i: int in range(3):
var y: float = 770 + i * 120
draw_colored_polygon(PackedVector2Array([Vector2(3150, y), Vector2(3220, y), Vector2(3185, y + 38)]), Color(0.75, 0.23, 0.42, 0.7))
draw_rect(Rect2(3040, 470, 28, 240), Color(0.27, 0.22, 0.31))
draw_rect(Rect2(3095, 470, 28, 240), Color(0.27, 0.22, 0.31))
draw_rect(Rect2(3040, 445, 84, 32), Color(0.37, 0.27, 0.39))
# Cripta: columnas, arco, luna ensangrentada y antorchas.
draw_circle(Vector2(3790, 890), 64, Color(0.69, 0.18, 0.23, 0.35))
for x: float in [3340.0, 3520.0, 4030.0, 4240.0]: