Initial commit.
This commit is contained in:
BIN
src/dk/itu/mario/MarioInterface/.DS_Store
vendored
Normal file
BIN
src/dk/itu/mario/MarioInterface/.DS_Store
vendored
Normal file
Binary file not shown.
10
src/dk/itu/mario/MarioInterface/Constraints.java
Normal file
10
src/dk/itu/mario/MarioInterface/Constraints.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package dk.itu.mario.MarioInterface;
|
||||
|
||||
public interface Constraints {
|
||||
// the submitted level should has exactly the following information
|
||||
public static int levelWidth= 320;
|
||||
public static int gaps = 10;
|
||||
public static int turtels = 7;
|
||||
public static int coinBlocks = 10;
|
||||
|
||||
}
|
||||
101
src/dk/itu/mario/MarioInterface/GamePlay.java
Normal file
101
src/dk/itu/mario/MarioInterface/GamePlay.java
Normal file
@@ -0,0 +1,101 @@
|
||||
package dk.itu.mario.MarioInterface;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class GamePlay implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public int completionTime; // counts only the current run on the level,
|
||||
// excluding death games
|
||||
public int totalTime;// sums all the time, including from previous games if
|
||||
// player died
|
||||
public int jumpsNumber; // total number of jumps
|
||||
public int duckNumber; // total number of ducks
|
||||
public int timeSpentDucking; // time spent in ducking mode
|
||||
public int timesPressedRun;// number of times the run key pressed
|
||||
public int timeSpentRunning; // total time spent running
|
||||
public int timeRunningRight; // total time spent running to the right
|
||||
public int timeRunningLeft;// total time spent running to the left
|
||||
public int emptyBlocksDestroyed; // number of empty blocks destroyed
|
||||
public int coinsCollected; // number of coins collected
|
||||
public int coinBlocksDestroyed; // number of coin block destroyed
|
||||
public int powerBlocksDestroyed; // number of power block destroyed
|
||||
public int kickedShells; // number of shells Mario kicked
|
||||
public int enemyKillByFire; // number of enemies killed by shooting them
|
||||
public int enemyKillByKickingShell; // number of enemies killed by kicking a
|
||||
// shell on them
|
||||
public int totalTimeLittleMode; // total time spent in little mode
|
||||
public int totalTimeLargeMode; // total time spent in large mode
|
||||
public int totalTimeFireMode; // total time spent in fire mode
|
||||
public int timesSwichingPower; // number of Times Switched Between Little,
|
||||
// Large or Fire Mario
|
||||
public double aimlessJumps; // number of jumps without a reason
|
||||
public double percentageBlocksDestroyed; // percentage of all blocks
|
||||
// destroyed
|
||||
public double percentageCoinBlocksDestroyed; // percentage of coin blocks
|
||||
// destroyed
|
||||
public double percentageEmptyBlockesDestroyed; // percentage of empty blocks
|
||||
// destroyed
|
||||
public double percentagePowerBlockDestroyed; // percentage of power blocks
|
||||
// destroyed
|
||||
public double timesOfDeathByFallingIntoGap; // number of death by falling
|
||||
// into a gap
|
||||
public int totalEnemies; // total number of enemies
|
||||
public int totalEmptyBlocks; // total number of empty blocks
|
||||
public int totalCoinBlocks; // total number of coin blocks
|
||||
public int totalpowerBlocks; // total number of power blocks
|
||||
public int totalCoins; // total number of coins
|
||||
public int timesOfDeathByRedTurtle; // number of times Mario died by red
|
||||
// turtle
|
||||
public int timesOfDeathByGoomba; // number of times Mario died by Goomba
|
||||
public int timesOfDeathByGreenTurtle; // number of times Mario died by green
|
||||
// turtle
|
||||
public int timesOfDeathByArmoredTurtle; // number of times Mario died by
|
||||
// Armored turtle
|
||||
public int timesOfDeathByJumpFlower; // number of times Mario died by Jump
|
||||
// Flower
|
||||
public int timesOfDeathByCannonBall; // number of time Mario died by Cannon
|
||||
// Ball
|
||||
public int timesOfDeathByChompFlower; // number of times Mario died by Chomp
|
||||
// Flower
|
||||
public int RedTurtlesKilled; // number of Red Turtle Mario killed
|
||||
public int GreenTurtlesKilled;// number of Green Turtle Mario killed
|
||||
public int ArmoredTurtlesKilled; // number of Armored Turtle Mario killed
|
||||
public int GoombasKilled; // number of Goombas Mario killed
|
||||
public int CannonBallKilled; // number of Cannon Ball Mario killed
|
||||
public int JumpFlowersKilled; // number of Jump Flower Mario killed
|
||||
public int ChompFlowersKilled; // number of Chomp Flower Mario killed
|
||||
|
||||
public void write(String fileName) {
|
||||
ObjectOutputStream out = null;
|
||||
try {
|
||||
FileOutputStream fos = new FileOutputStream(fileName);
|
||||
out = new ObjectOutputStream(fos);
|
||||
out.writeObject(this);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static GamePlay read(String fileName) {
|
||||
FileInputStream fis = null;
|
||||
ObjectInputStream in = null;
|
||||
GamePlay gp = null;
|
||||
try {
|
||||
fis = new FileInputStream(fileName);
|
||||
in = new ObjectInputStream(fis);
|
||||
gp = (GamePlay) in.readObject();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return gp;
|
||||
}
|
||||
}
|
||||
12
src/dk/itu/mario/MarioInterface/LevelGenerator.java
Normal file
12
src/dk/itu/mario/MarioInterface/LevelGenerator.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package dk.itu.mario.MarioInterface;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public interface LevelGenerator {
|
||||
|
||||
//Use one of these methods to generate your level
|
||||
|
||||
public LevelInterface generateLevel (GamePlay playerMetrics);
|
||||
public LevelInterface generateLevel (String detailedInfo);
|
||||
}
|
||||
41
src/dk/itu/mario/MarioInterface/LevelInterface.java
Normal file
41
src/dk/itu/mario/MarioInterface/LevelInterface.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package dk.itu.mario.MarioInterface;
|
||||
|
||||
import dk.itu.mario.engine.sprites.SpriteTemplate;
|
||||
|
||||
public interface LevelInterface {
|
||||
|
||||
public static byte[] TILE_BEHAVIORS = new byte[256];
|
||||
|
||||
public static final int TYPE_OVERGROUND = 0;
|
||||
public static final int TYPE_UNDERGROUND = 1;
|
||||
public static final int TYPE_CASTLE = 2;
|
||||
|
||||
public static final int BIT_BLOCK_UPPER = 1 << 0;
|
||||
public static final int BIT_BLOCK_ALL = 1 << 1;
|
||||
public static final int BIT_BLOCK_LOWER = 1 << 2;
|
||||
public static final int BIT_SPECIAL = 1 << 3; //mashroom or flower
|
||||
public static final int BIT_BUMPABLE = 1 << 4;
|
||||
public static final int BIT_BREAKABLE = 1 << 5;
|
||||
public static final int BIT_PICKUPABLE = 1 << 6;
|
||||
public static final int BIT_ANIMATED = 1 << 7;
|
||||
|
||||
public void tick();
|
||||
|
||||
//Map of WIDTH * HEIGHT that contains the level's design
|
||||
public byte[][] getMap();
|
||||
|
||||
//Map of WIDTH * HEIGHT and contains the placement and type enemies
|
||||
public SpriteTemplate[][] getSpriteTemplates();
|
||||
|
||||
public int getWidth();
|
||||
|
||||
public int getHeight();
|
||||
|
||||
//These are the place where the level ends
|
||||
public int getxExit();
|
||||
|
||||
public int getyExit();
|
||||
|
||||
public String getName();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user