Skip to content

Running & Testing Level Generators

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

The instructions here describe the steps needed to run and test level generators that you have created.

Running Sample Level Generators

Disabling Other Runners

In the file src/Test.java, comment out any code blocks related to running instances of the game. At the very least, you should be commenting out the following line:

// 1. This starts a game, in a level, played by a human.
// ArcadeMachine.playOneGame(game, level1, recordActionsFile, seed); // Make sure this line is commented out.

Enabling The Level Generator Runner

In the same file src/Test.java, locate the following code block and make sure it is uncommented (i.e., the code will be run.)

//5. This starts a game, in a generated level created by a specific level generator
if(ArcadeMachine.generateOneLevel(game, geneticGenerator, recordLevelFile)){
        ArcadeMachine.playOneGeneratedLevel(game, recordActionsFile, recordLevelFile, seed);
}

Switching the sample level generator

Replace the variable geneticGenerator with any of the following:

  • randomLevelGenerator
  • geneticGenerator
  • constructiveLevelGenerator

Table of Contents:

Clone this wiki locally