diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index da5e24e..dcd0ff9 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,10 +3,8 @@
+
-
-
-
@@ -213,7 +211,7 @@
-
+
@@ -235,6 +233,6 @@
-
+
\ No newline at end of file
diff --git a/Mario-AI-Interface/reps/f_l_sav.rep b/Mario-AI-Interface/reps/f_l_sav.rep
index bbf1ad9..c1ee6d3 100644
Binary files a/Mario-AI-Interface/reps/f_l_sav.rep and b/Mario-AI-Interface/reps/f_l_sav.rep differ
diff --git a/Mario-AI-Interface/src/Play.java b/Mario-AI-Interface/src/Play.java
index 656dd3b..a4c81db 100644
--- a/Mario-AI-Interface/src/Play.java
+++ b/Mario-AI-Interface/src/Play.java
@@ -41,12 +41,12 @@ public class Play {
public static byte[] playJavaGame(){
MarioGame game = new MarioGame();
- game.setLives(20);
+ game.setLives(3);
String levelPath = "./levels/group0/lvl1.lvl"; // For local
String repPath = "./reps/f_l_sav.rep"; // For local
//MarioGame.verbose = true;
//Play Game
- MarioResult tmpResult = game.playGame(new HumanAgent(false),getLevel(levelPath), 100, repPath,30);
+ MarioResult tmpResult = game.playGame(new HumanAgent(false),getLevel(levelPath), 10, repPath,30);
//Replay
//MarioResult tmpResult = game.playGame(Replay.getRepAgentFromFile(repPath),getLevel(levelPath), 30, repPath,30);
return Replay.serializeAgentEvents(tmpResult.getAgentEvents());
diff --git a/Mario-AI-Interface/src/engine/core/MarioRender.java b/Mario-AI-Interface/src/engine/core/MarioRender.java
index d3bef9b..2753b15 100644
--- a/Mario-AI-Interface/src/engine/core/MarioRender.java
+++ b/Mario-AI-Interface/src/engine/core/MarioRender.java
@@ -16,6 +16,7 @@ public class MarioRender extends JComponent implements FocusListener {
public static final int TICKS_PER_SECOND = 24;
private float scale;
+ private int renderBuffer;
private GraphicsConfiguration graphicsConfiguration;
int frame;
@@ -57,23 +58,44 @@ public class MarioRender extends JComponent implements FocusListener {
drawStringDropShadow(og, "Buttons: " + pressedButtons, 0, 2, 1);
}
//Render Status Info
-
+ boolean renderOcuppied = false;
switch (world.gameStatus){
case LOSE:
drawString(og,"Game Over! ",64,40,1,1.5f);
drawString(og,"YOU LOSE! ",66,56,1,1.5f);
+ renderOcuppied = true;
break;
case TIME_OUT:
drawString(og,"Game Over! ",64,40,1,1.5f);
drawString(og,"Time OUT ",66,56,1,1.5f);
+ renderOcuppied = true;
break;
case WIN:
drawString(og,"CONGRATULATION!",32,40,1,1.5f);
drawString(og,"YOU WIN!!",64,56,1,1.5f);
+ renderOcuppied = true;
break;
}
+ if (!renderOcuppied){
+ System.out.println(renderBuffer);
+ if(world.deathBuffer > 999){
+ renderBuffer = 150;
+ }
+ if(renderBuffer>0){
+ if((renderBuffer/10)%2 == 1){
+ drawString(og,"YOU LOSE ONE LIFE!!",56,56,1,1f);
+ }else{
+ drawString(og,"YOU LOSE ONE LIFE!!",56,56,0,1f);
+ }
+ renderBuffer--;
+ }
+
+
+
+ }
+
if (scale > 1) {
g.drawImage(image, 0, 0, (int) (256 * scale), (int) (240 * scale), null);
} else {