V4 lab drops

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-21 13:55:25 +02:00
1 parent aeb5b324f1
commit f1363dd6c8
11 files changed
+157 -37

No files matched your search

+14
View File
@@ -58,5 +58,19 @@ class PickupResourceTests(unittest.TestCase):
self.assertIn("pickup.collection_delay_seconds = Pickup.DROP_COLLECTION_DELAY_SECONDS", code)
def test_moving_across_a_drop_cannot_lose_the_pickup(self):
pickup = (ROOT / "pickups" / "pickup.gd").read_text(encoding="utf-8")
scene = (ROOT / "pickups" / "pickup.tscn").read_text(encoding="utf-8")
player = (ROOT / "player" / "player.gd").read_text(encoding="utf-8")
hud = (ROOT / "ui" / "hud" / "player_health_hud.gd").read_text(encoding="utf-8")
self.assertIn("_pending_collector", pickup, "Touches during the delay must be buffered")
self.assertIn("for body in get_overlapping_bodies():", pickup, "Overlaps must be retried")
self.assertIn("size = Vector2(28, 24)", scene, "Use a forgiving trigger without scaling the sprite")
self.assertIn("func get_move_speed() -> float:", player)
self.assertIn("direction * get_move_speed()", player)
self.assertIn('player_ref.call("get_move_speed")', hud)
if __name__ == "__main__":
unittest.main()