Refactoring to allow MyNewLevelGenerator to determine the level type, difficulty and music based on the player metrics.

Work in progress.
This commit is contained in:
Woody Folsom
2012-03-17 10:26:33 -04:00
parent 47520126ff
commit a827ca7430
9 changed files with 141 additions and 63 deletions

View File

@@ -51,8 +51,8 @@ public class LevelScene extends Scene implements SpriteContext {
protected long levelSeed;
protected MarioComponent marioComponent;
protected int levelType;
protected int levelDifficulty;
//protected int levelType;
//protected int levelDifficulty;
public static DataRecorder recorder;
@@ -66,12 +66,12 @@ public class LevelScene extends Scene implements SpriteContext {
private int xArrow, yArrow;
public LevelScene(GraphicsConfiguration graphicsConfiguration,
MarioComponent renderer, long seed, int levelDifficulty, int type) {
MarioComponent renderer, long seed/*, int levelDifficulty, int type*/) {
this.graphicsConfiguration = graphicsConfiguration;
this.levelSeed = seed;
this.marioComponent = renderer;
this.levelDifficulty = levelDifficulty;
this.levelType = type;
//this.levelDifficulty = levelDifficulty;
//this.levelType = type;
widthArrow = 25;
tipWidthArrow = 10;
@@ -282,7 +282,7 @@ public class LevelScene extends Scene implements SpriteContext {
private DecimalFormat df = new DecimalFormat("00");
private DecimalFormat df2 = new DecimalFormat("000");
public void render(Graphics g, float alpha) {
int xCam = (int) (mario.xOld + (mario.x - mario.xOld) * alpha) - 160;
int yCam = (int) (mario.yOld + (mario.y - mario.yOld) * alpha) - 120;