-
Notifications
You must be signed in to change notification settings - Fork 73
/
GenerateLevel.java
31 lines (29 loc) · 1.9 KB
/
GenerateLevel.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import engine.core.MarioGame;
import engine.core.MarioLevelGenerator;
import engine.core.MarioLevelModel;
import engine.core.MarioResult;
import engine.core.MarioTimer;
public class GenerateLevel {
public static void printResults(MarioResult result) {
System.out.println("****************************************************************");
System.out.println("Game Status: " + result.getGameStatus().toString() +
" Percentage Completion: " + result.getCompletionPercentage());
System.out.println("Lives: " + result.getCurrentLives() + " Coins: " + result.getCurrentCoins() +
" Remaining Time: " + (int) Math.ceil(result.getRemainingTime() / 1000f));
System.out.println("Mario State: " + result.getMarioMode() +
" (Mushrooms: " + result.getNumCollectedMushrooms() + " Fire Flowers: " + result.getNumCollectedFireflower() + ")");
System.out.println("Total Kills: " + result.getKillsTotal() + " (Stomps: " + result.getKillsByStomp() +
" Fireballs: " + result.getKillsByFire() + " Shells: " + result.getKillsByShell() +
" Falls: " + result.getKillsByFall() + ")");
System.out.println("Bricks: " + result.getNumDestroyedBricks() + " Jumps: " + result.getNumJumps() +
" Max X Jump: " + result.getMaxXJump() + " Max Air Time: " + result.getMaxJumpAirTime());
System.out.println("****************************************************************");
}
public static void main(String[] args) {
MarioLevelGenerator generator = new levelGenerators.notch.LevelGenerator();
String level = generator.getGeneratedLevel(new MarioLevelModel(150, 16), new MarioTimer(5 * 60 * 60 * 1000));
MarioGame game = new MarioGame();
// printResults(game.playGame(level, 200, 0));
printResults(game.runGame(new agents.robinBaumgarten.Agent(), level, 20, 0, true));
}
}