Fix para los items que no caen
This commit is contained in:
1 parent
e1e29f02f1
commit
aeb5b324f1
28 files changed
+194
-54
No files matched your search
@@ -20,7 +20,7 @@ func _run() -> void:
|
||||
await process_frame
|
||||
|
||||
var status: Label = level.get_node("TestHUD/Overlay/Status") as Label
|
||||
if not status.text.contains("LAB DROPS v2"):
|
||||
if not status.text.contains("LAB DROPS v3"):
|
||||
_fail("No se esta ejecutando level_01.gd")
|
||||
return
|
||||
|
||||
@@ -32,6 +32,29 @@ func _run() -> void:
|
||||
if not control.visible or control.get_node("Sprite2D").texture == null:
|
||||
_fail("El pickup de control no tiene icono visible")
|
||||
return
|
||||
if control.get_node("Label").text != control.pickup_data.display_name:
|
||||
_fail("El nombre del pickup sigue siendo Item")
|
||||
return
|
||||
if not control.monitoring or not control.get("_can_collect"):
|
||||
_fail("Un objeto fijo debe ser recogible desde el primer instante")
|
||||
return
|
||||
|
||||
# Test a real collision, not a direct call to collect_pickup(). This used
|
||||
# to fail when monitoring was disabled while the player ran past the item.
|
||||
var player: CharacterBody2D = level.get_node("Player") as CharacterBody2D
|
||||
player.global_position = control.global_position
|
||||
await physics_frame
|
||||
await physics_frame
|
||||
await process_frame
|
||||
if is_instance_valid(control):
|
||||
_fail("El jugador ha tocado el objeto de control, pero no lo ha recogido")
|
||||
return
|
||||
if int(player.get("_shield_hits")) < 1:
|
||||
_fail("El efecto de escudo del objeto de control no se aplico")
|
||||
return
|
||||
if level.collected_items.size() != 0:
|
||||
_fail("El objeto de control no debe contar entre los 17 drops")
|
||||
return
|
||||
|
||||
var enemies: Array[Node] = level.get_node("TestEnemies").get_children()
|
||||
if enemies.size() != 17:
|
||||
@@ -62,8 +85,8 @@ func _run() -> void:
|
||||
return
|
||||
|
||||
var pickups: Array[Node] = get_nodes_in_group("pickup")
|
||||
if pickups.size() != 18:
|
||||
_fail("Se esperaban 17 drops mas el control, hay %d" % pickups.size())
|
||||
if pickups.size() != 17:
|
||||
_fail("Se esperaban 17 drops; el control ya se ha recogido. Hay %d" % pickups.size())
|
||||
return
|
||||
|
||||
var actual_ids: Dictionary = {}
|
||||
@@ -75,8 +98,8 @@ func _run() -> void:
|
||||
if pickup.get_node("Sprite2D").texture == null:
|
||||
_fail("Pickup sin icono: %s" % pickup.pickup_data.id)
|
||||
return
|
||||
if pickup.monitoring:
|
||||
_fail("Pickup activo antes de los 0.75 s: %s" % pickup.pickup_data.id)
|
||||
if not pickup.monitoring or bool(pickup.get("_can_collect")):
|
||||
_fail("El drop debe detectar solapes, pero esperar 0.75 s para recogerse: %s" % pickup.pickup_data.id)
|
||||
return
|
||||
if pickup.pickup_data.id != &"lab_control":
|
||||
actual_ids[pickup.pickup_data.id] = true
|
||||
@@ -86,11 +109,11 @@ func _run() -> void:
|
||||
return
|
||||
|
||||
await create_timer(0.2).timeout
|
||||
if get_nodes_in_group("pickup").size() != 18:
|
||||
if get_nodes_in_group("pickup").size() != 17:
|
||||
_fail("Se duplicaron o perdieron drops al procesar frames adicionales")
|
||||
return
|
||||
|
||||
print("OK LAB DROPS v2: 17 KOs, 17 recompensas distintas, 1 control, 1 senal desconectada")
|
||||
print("OK LAB DROPS: control recogido por colision, 17 KOs, 17 recompensas, 1 senal desconectada")
|
||||
quit(0)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user