Update Death Time & Speed
This commit is contained in:
parent
1083a4ca03
commit
b017291b00
12
.idea/workspace.xml
generated
12
.idea/workspace.xml
generated
@ -3,14 +3,10 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="c32bfd4e-6189-47f3-9d6c-c1825d3d7e5f" name="Changes" comment="">
|
<list default="true" id="c32bfd4e-6189-47f3-9d6c-c1825d3d7e5f" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/IDManager.py" beforeDir="false" afterPath="$PROJECT_DIR$/IDManager.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/reps/f_l_sav.rep" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioGame.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioRender.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioRender.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioWorld.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/core/MarioWorld.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/helper/Assets.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/engine/helper/Assets.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/data/annotation.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/annotation.csv" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@ -217,7 +213,7 @@
|
|||||||
<workItem from="1677563906178" duration="5318000" />
|
<workItem from="1677563906178" duration="5318000" />
|
||||||
<workItem from="1677572224495" duration="2432000" />
|
<workItem from="1677572224495" duration="2432000" />
|
||||||
<workItem from="1677595224096" duration="799000" />
|
<workItem from="1677595224096" duration="799000" />
|
||||||
<workItem from="1677674512203" duration="1323000" />
|
<workItem from="1677674512203" duration="2230000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
@ -239,6 +235,6 @@
|
|||||||
<SUITE FILE_PATH="coverage/MarioWeb$MarioWeb.coverage" NAME="MarioWeb Coverage Results" MODIFIED="1669305478201" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
<SUITE FILE_PATH="coverage/MarioWeb$MarioWeb.coverage" NAME="MarioWeb Coverage Results" MODIFIED="1669305478201" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$test.coverage" NAME="test Coverage Results" MODIFIED="1668079935841" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/MarioWeb$test.coverage" NAME="test Coverage Results" MODIFIED="1668079935841" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1677224605926" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1677224605926" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py___1_.coverage" NAME="Flask (main.py) (1) Coverage Results" MODIFIED="1677675778967" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py___1_.coverage" NAME="Flask (main.py) (1) Coverage Results" MODIFIED="1677679335503" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
Binary file not shown.
@ -211,6 +211,12 @@ public class MarioGame extends KeyAdapter{
|
|||||||
replayBreak = true;
|
replayBreak = true;
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
|
if(world.deathBuffer >0){
|
||||||
|
actions = new boolean[6];
|
||||||
|
world.deathBuffer -= 30;
|
||||||
|
}else{
|
||||||
|
world.deathBuffer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// update world
|
// update world
|
||||||
this.world.update(actions);
|
this.world.update(actions);
|
||||||
@ -234,6 +240,11 @@ public class MarioGame extends KeyAdapter{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Pause 1 second before return
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
MarioResult res = new MarioResult(this.world, gameEvents, agentEvents);
|
MarioResult res = new MarioResult(this.world, gameEvents, agentEvents);
|
||||||
if (!resultPath.isEmpty()&&!replayBreak) {
|
if (!resultPath.isEmpty()&&!replayBreak) {
|
||||||
Replay.saveReplay(resultPath, res.getAgentEvents());
|
Replay.saveReplay(resultPath, res.getAgentEvents());
|
||||||
|
@ -30,6 +30,8 @@ public class MarioWorld {
|
|||||||
public int airStart, airTime;
|
public int airStart, airTime;
|
||||||
public ArrayList<MarioEvent> lastFrameEvents;
|
public ArrayList<MarioEvent> lastFrameEvents;
|
||||||
|
|
||||||
|
public int deathBuffer;
|
||||||
|
|
||||||
// private int segTime = -1;
|
// private int segTime = -1;
|
||||||
// private int passedSegs = 0;
|
// private int passedSegs = 0;
|
||||||
private MarioEvent[] killEvents;
|
private MarioEvent[] killEvents;
|
||||||
@ -59,6 +61,7 @@ public class MarioWorld {
|
|||||||
this.lives = 0;
|
this.lives = 0;
|
||||||
this.kills = 0;
|
this.kills = 0;
|
||||||
this.deaths = 0;
|
this.deaths = 0;
|
||||||
|
this.deathBuffer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeVisuals(GraphicsConfiguration graphicsConfig) {
|
public void initializeVisuals(GraphicsConfiguration graphicsConfig) {
|
||||||
@ -241,6 +244,9 @@ public class MarioWorld {
|
|||||||
}
|
}
|
||||||
this.mario.x = (float)(newTileX * 16.0 + 8);
|
this.mario.x = (float)(newTileX * 16.0 + 8);
|
||||||
this.mario.y = (float)(newTileY * 16.0);
|
this.mario.y = (float)(newTileY * 16.0);
|
||||||
|
//Death Buffer
|
||||||
|
deathBuffer = 1000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[][] getSceneObservation(float centerX, float centerY, int detail) {
|
public int[][] getSceneObservation(float centerX, float centerY, int detail) {
|
||||||
@ -360,10 +366,6 @@ public class MarioWorld {
|
|||||||
|
|
||||||
if (this.currentTimer > 0) {
|
if (this.currentTimer > 0) {
|
||||||
this.currentTimer -= 30;
|
this.currentTimer -= 30;
|
||||||
// if (this.segTime > 0 && (int) (this.mario.x / 256) > this.passedSegs) {
|
|
||||||
// this.passedSegs = (int) (this.mario.x / 256);
|
|
||||||
// this.currentTimer = Math.min(this.currentTimer + this.segTime, 2 * this.segTime) ;
|
|
||||||
// }
|
|
||||||
if (this.currentTimer <= 0) {
|
if (this.currentTimer <= 0) {
|
||||||
this.currentTimer = 0;
|
this.currentTimer = 0;
|
||||||
this.timeout();
|
this.timeout();
|
||||||
|
@ -408,6 +408,8 @@ public class Mario extends MarioSprite {
|
|||||||
if (this.world.lives <= 0) {
|
if (this.world.lives <= 0) {
|
||||||
this.world.lose();
|
this.world.lose();
|
||||||
} else {
|
} else {
|
||||||
|
world.deathBuffer = 1000;
|
||||||
|
xa = 0;
|
||||||
this.world.lives -= 1;
|
this.world.lives -= 1;
|
||||||
this.world.deaths += 1;
|
this.world.deaths += 1;
|
||||||
world.pauseTimer = 3 * POWERUP_TIME;
|
world.pauseTimer = 3 * POWERUP_TIME;
|
||||||
@ -430,6 +432,8 @@ public class Mario extends MarioSprite {
|
|||||||
} else if (invulnerableTime <= 0) {
|
} else if (invulnerableTime <= 0) {
|
||||||
this.world.lives -= 1;
|
this.world.lives -= 1;
|
||||||
this.world.deaths += 1;
|
this.world.deaths += 1;
|
||||||
|
world.deathBuffer = 1000;
|
||||||
|
xa = 0;
|
||||||
world.pauseTimer = 3 * POWERUP_TIME;
|
world.pauseTimer = 3 * POWERUP_TIME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,3 +206,5 @@ IP,Style,Frequency,Age,Gender
|
|||||||
1,B,A,A,C,A,A,,
|
1,B,A,A,C,A,A,,
|
||||||
1,A,A,A,D,A,A,,
|
1,A,A,A,D,A,A,,
|
||||||
1,A,A,A,B,A,A,,
|
1,A,A,A,B,A,A,,
|
||||||
|
2,A,A,A,A,A,A,,
|
||||||
|
1,A,A,A,A,A,A,,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user