Mejora de combate con boss
This commit is contained in:
1 parent
f414d43a37
commit
d983bc2e69
11 files changed
+1076
-77
No files matched your search
+10
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user