Fix para los items que no caen

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-21 11:22:00 +02:00
1 parent 1e70a99224
commit 5012879591
9 files changed
+144 -1468

No files matched your search

+18 -2
View File
@@ -16,6 +16,7 @@ const FINISH_RESTART_SECONDS: float = 8.0
@onready var finish_message: Label = $TestHUD/Overlay/FinishMessage
var collected_items: Dictionary = {} # PickupData.id -> true; count each only once
var defeated_enemies: int = 0
var showing_victory: bool = false
var victory_timer: float = 0.0
@@ -30,6 +31,12 @@ func _ready() -> void:
$FinishZone.body_entered.connect(_on_finish_entered)
$DeathZone.body_entered.connect(_on_death_entered)
player.connect(&"pickup_collected", _on_pickup_collected)
for enemy in test_enemies.get_children():
# Catch missing scene overrides as soon as the level starts rather than
# silently falling back to the normal random drop table.
if enemy.get("guaranteed_drop") == null:
push_error("%s has no guaranteed_drop assigned." % enemy.name)
enemy.died.connect(_on_station_enemy_died)
_update_status()
@@ -58,11 +65,20 @@ func _update_status() -> void:
next_item = data.display_name
break
status_label.text = "LAB THRASH %02d / %02d recogidos\nSIGUIENTE: %s" % [
collected_items.size(), TEST_ITEM_COUNT, next_item
# Two independent counters reveal whether an object failed to spawn or
# simply got collected. Useful for diagnosing drops on an Android APK.
var loose_drops: int = get_tree().get_nodes_in_group("pickup").size()
status_label.text = "LAB: %02d/%02d objetos | %02d KOs\nDROPS EN SUELO: %02d\nSIGUIENTE: %s" % [
collected_items.size(), TEST_ITEM_COUNT, defeated_enemies,
loose_drops, next_item
]
func _on_station_enemy_died() -> void:
defeated_enemies += 1
_update_status()
func _on_pickup_collected(data: PickupData) -> void:
# A heal at full HP or a charge item with a full meter isn't consumed and
# doesn't count. The object remains on the floor for later collection.
+1 -1
View File
@@ -412,7 +412,7 @@ anchor_right = 1.0
offset_left = -500.0
offset_top = 16.0
offset_right = -20.0
offset_bottom = 72.0
offset_bottom = 104.0
grow_horizontal = 0
theme_override_colors/font_color = Color(1, 0.93, 0.68, 1)
theme_override_colors/font_shadow_color = Color(0.02, 0.02, 0.02, 0.95)