Merge branch 'master' of woodyfolsom.net:/opt/git/cs8803p3
This commit is contained in:
@@ -9,6 +9,6 @@ public class FitnessEvaluator {
|
||||
System.out.println("Evaluating LevelParseTree for fitness");
|
||||
List<LevelComponent> levelTemplate = parseTree.getLevelTemplate();
|
||||
//a good level has 8-16 components, plus some additional complexity depending on the player's skill level
|
||||
return levelTemplate.size() > 7 && levelTemplate.size() < 17;
|
||||
return levelTemplate.size() > 9 && levelTemplate.size() < 25;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,26 @@ package dk.itu.mario.level;
|
||||
|
||||
public class LevelComponent {
|
||||
public enum TYPE {
|
||||
BLOCKS, COINS, FLAT_HI, FLAT_LO, FLAT_SAFE, HI_LO, HI_PATH, LEVEL_SEGMENT, LEVEL, LO_HI, LO_PATH, MAZE, PIPE_JUMP, PLATFORM_JUMP, POWER_UP
|
||||
BLOCKS,
|
||||
BOWLING_ALLEY,
|
||||
CANNON_LINE,
|
||||
COIN_DIVE,
|
||||
FLAT_HI,
|
||||
FLAT_LO,
|
||||
FLAT_SAFE,
|
||||
HI_LO,
|
||||
HI_PATH,
|
||||
LEMMING_TRAP,
|
||||
LEVEL_SEGMENT,
|
||||
LEVEL,
|
||||
LO_HI,
|
||||
LO_PATH,
|
||||
MAZE,
|
||||
PIPE_JUMP,
|
||||
PLATFORM_JUMP,
|
||||
POWER_UP,
|
||||
SINGLE_PIT,
|
||||
CHALLENGE
|
||||
};
|
||||
|
||||
public enum MazeLevel {
|
||||
|
||||
@@ -1146,6 +1146,28 @@ public class PCGLevel extends Level {
|
||||
case MAZE:
|
||||
length += buildMaze(length, width - 64 - length);
|
||||
break;
|
||||
case BLOCKS:
|
||||
length += buildMaze(length, width - 64 - length);
|
||||
break;
|
||||
case BOWLING_ALLEY :
|
||||
length += buildBowlingAlley(length, width - 64 - length);
|
||||
break;
|
||||
case CANNON_LINE :
|
||||
length += buildCannonLine(length, width - 64 - length);
|
||||
break;
|
||||
case COIN_DIVE :
|
||||
length += buildCoinDive(length, width - 64 - length);
|
||||
break;
|
||||
case LEMMING_TRAP :
|
||||
length += buildLemmingTrap(length, width - 64 - length);
|
||||
break;
|
||||
case POWER_UP :
|
||||
length += buildFreebie(length, width - 64 - length);
|
||||
//length += buildStraight(length, lcomp.getEnd(), true);
|
||||
break;
|
||||
case SINGLE_PIT :
|
||||
length += buildSinglePit(length, width - 64 - length);
|
||||
break;
|
||||
default:
|
||||
System.out
|
||||
.println("Cannot build level segment for unrecognized LevelComponent type: "
|
||||
|
||||
@@ -83,6 +83,9 @@ public class LevelGrammarFactory {
|
||||
}
|
||||
|
||||
String remainder = clause.substring(rBraceIndex);
|
||||
if (remainder.startsWith("}, ")) {
|
||||
remainder = remainder.substring(3);
|
||||
}
|
||||
List<String> rhsClauseStrings = new ArrayList<String>();
|
||||
if (remainder.contains("(")) {
|
||||
int nextLeftIndex = -1;
|
||||
|
||||
Reference in New Issue
Block a user