Завершить инженерную проверку этапа 2

This commit is contained in:
2026-08-18 13:54:48 +03:00
parent 3ad959dde0
commit 80822b74b1
17 changed files with 384 additions and 69 deletions
@@ -100,6 +100,24 @@ public final class LevelCatalogTest {
freezer.box.x, freezer.box.y, freezer.box.width, freezer.box.height));
}
@Test
public void masteryFreezerKillsOnTheFloorButNotOnTopOfItsFrozenBlock() {
LevelDefinition level = LevelCatalog.get(9);
LevelDefinition.Hazard freezer = null;
for (LevelDefinition.Hazard hazard : level.hazards) {
if (hazard.type == LevelDefinition.HazardType.FREEZER) freezer = hazard;
}
assertTrue("Level 10 must contain its freezer", freezer != null);
float frozenBlockTop = 880f - 104f;
assertTrue("A floor-running volunteer must still hit the mastery freezer",
GameMath.intersects(1_108f, 780f, 62f, 100f,
freezer.box.x, freezer.box.y, freezer.box.width, freezer.box.height));
assertFalse("A volunteer standing on the mastery frozen block must clear the freezer",
GameMath.intersects(1_108f, frozenBlockTop - 100f, 62f, 100f,
freezer.box.x, freezer.box.y, freezer.box.width, freezer.box.height));
}
@Test
public void masteryLiftHasLaunchOverlapAndStillSpansARealPit() {
LevelDefinition level = LevelCatalog.get(9);
@@ -118,17 +136,40 @@ public final class LevelCatalogTest {
float launchOverlap = Math.min(launchFloor.box.right(), lift.box.right())
- Math.max(launchFloor.box.x, lift.box.x);
assertTrue("The floor must overlap the lift by at least 100px for a stable launch",
launchOverlap >= 100f);
assertTrue("The floor must overlap the lift by at least 140px for a delayed launch",
launchOverlap >= 140f);
assertEquals("The pit must begin exactly where the launch floor ends",
launchFloor.box.right(), pit.box.x, 0f);
assertEquals("The pit must continue to the landing floor",
landingFloor.box.x, pit.box.right(), 0f);
assertTrue("The final pit must remain at least 200px wide", pit.box.width >= 200f);
assertTrue("The mastery lift cycle must leave a readable delayed-input boarding window",
lift.periodSeconds >= 10f);
assertTrue("The upper gallery must still require the vertical lift",
lift.travelY <= -400f && level.goal.y < launchFloor.box.y - 300f);
}
@Test
public void timedPlatformHasLaunchOverlapAndStillSpansARealPit() {
LevelDefinition level = LevelCatalog.get(7);
LevelDefinition.Platform launchFloor = level.platforms.get(0);
LevelDefinition.Platform landingFloor = level.platforms.get(1);
LevelDefinition.Platform movingPlatform = level.platforms.get(3);
LevelDefinition.Hazard pit = level.hazards.get(0);
float launchOverlap = Math.min(launchFloor.box.right(), movingPlatform.box.right())
- Math.max(launchFloor.box.x, movingPlatform.box.x);
assertTrue("The timed platform must overlap the launch floor by at least 50px",
launchOverlap >= 50f);
assertTrue("The timed platform needs a 320px left-side catch window",
movingPlatform.box.width >= 320f);
assertEquals("Widening must preserve the original right edge for recovery safety",
1_230f, movingPlatform.box.right(), 0f);
assertEquals(launchFloor.box.right(), pit.box.x, 0f);
assertEquals(landingFloor.box.x, pit.box.right(), 0f);
assertTrue("Borrowed Time must retain a real platforming pit", pit.box.width >= 450f);
}
@Test
public void everyDoorAndControlledPlatformHasADeclaredSignalSource() {
for (LevelDefinition level : LevelCatalog.all()) {
@@ -23,6 +23,8 @@ public final class LevelPlaytestBotTest {
assertTrue(result.diagnostic(), result.completed());
assertEquals(7, driver.startedLevel);
assertEquals("Reach the goal", result.lastStep());
assertTrue("Completed steps must release held controls before the next action",
driver.inputReleases >= 2);
}
@Test
@@ -98,6 +100,7 @@ public final class LevelPlaytestBotTest {
private int deaths;
private boolean completed;
private final boolean progresses;
private int inputReleases;
ScriptedDriver() {
this(true);
@@ -119,6 +122,7 @@ public final class LevelPlaytestBotTest {
@Override
public void setInput(boolean moveLeft, boolean moveRight, boolean jump) {
if (!moveLeft && !moveRight && !jump) inputReleases++;
this.moveLeft = moveLeft;
this.moveRight = moveRight;
}