Стабилизировать посадку на лифт уровня 10
This commit is contained in:
@@ -100,6 +100,35 @@ public final class LevelCatalogTest {
|
||||
freezer.box.x, freezer.box.y, freezer.box.width, freezer.box.height));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void masteryLiftHasLaunchOverlapAndStillSpansARealPit() {
|
||||
LevelDefinition level = LevelCatalog.get(9);
|
||||
LevelDefinition.Platform launchFloor = level.platforms.get(0);
|
||||
LevelDefinition.Platform landingFloor = level.platforms.get(1);
|
||||
LevelDefinition.Platform lift = null;
|
||||
LevelDefinition.Hazard pit = null;
|
||||
for (LevelDefinition.Platform platform : level.platforms) {
|
||||
if (platform.isMoving()) lift = platform;
|
||||
}
|
||||
for (LevelDefinition.Hazard hazard : level.hazards) {
|
||||
if (hazard.type == LevelDefinition.HazardType.PIT) pit = hazard;
|
||||
}
|
||||
assertTrue("Level 10 must contain its moving lift", lift != null);
|
||||
assertTrue("Level 10 must retain its final pit", pit != null);
|
||||
|
||||
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);
|
||||
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 upper gallery must still require the vertical lift",
|
||||
lift.travelY <= -400f && level.goal.y < launchFloor.box.y - 300f);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void everyDoorAndControlledPlatformHasADeclaredSignalSource() {
|
||||
for (LevelDefinition level : LevelCatalog.all()) {
|
||||
|
||||
Reference in New Issue
Block a user