Merge branch 'main' of https://github.com/BigJIU/MarioWeb
This commit is contained in:
commit
75564a5f0d
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -2,15 +2,15 @@
|
|||||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-----------------------------------------------SSSS-SSS-----------------------SSSSSSSSSSSSSSSSSS----------------SSSSSSSSSSSSSSSS----------------S--SSSSSS-------
|
-----------------------------------------------SSSS-SSS-----------------------SSSSSSSSSSSSSSSSSS----------------SSSSSSSSSSSSSSSS----------------S--SSSSSS-------
|
||||||
----------o-----t-------------------------------------------------------------------SSSS--S----------------------SSSSSSSSSSSSSSS--------------------------------
|
----------o-----t-----------------S-------------------------------------------------SSSS--S----------------------SSSSSSSSSSSSSSS--------------------------------
|
||||||
%--------S------t--------------------------------------------------------------------SS--SSS--------------------SSSSSSSSSSSSSSS---------------------------------
|
%--------S------t--------------------------------------------------------------------SS--SSS--------------------SSSSSSSSSSSSSSS---------------------------------
|
||||||
|------------------------------o----------SSSSSS--------------------Q--------------S------SS-------------------o------S----KSSS---------------@%--S-------------
|
|------------------------------o----------SSSSSS--------------------Q--------------S------SS-------------------o------S----KSSS---------------@%--S-------------
|
||||||
|-----------------------------------------SSSSS------oo----------------------------------------------%---------------------SS------------------|----------------
|
|---------------------------------S-------SSSSS------oo----------------------------------------------%---------------------SS------------------|----------------
|
||||||
|--------------------------------------SSSSSSSS-%----%%%%%-%%--------------------------SS------------|-----------------------------------------|-----#----------
|
|--------------------------------------SSSSSSSS-%----%%%%%-%%--------------------------SS------------|-----------------------------------------|-----#----------
|
||||||
|--------o------------------------S--SS--SSSSS--|-----|||--||--------------------------r-------S-----|------------SSo-ooo---oSSS---------------|----##----------
|
|--------o------------------------S--SS--SSSSS--|-----|||--||--------------------------r-------S-----|------------SSo-ooo---oSSS---------------|----##----------
|
||||||
|------------------------------S----SSSSSSSSSSS-|-----|||--||-------------------%%%%%%%%%%------QQQ--|-QQ----------SSS%--%%%%%%%---#-----------|---####--##-##-#
|
|------------------------------S----SSSSSSSSSSS-|-----|||--||-------------------%%%%%%%%%%------QQQ--|-QQ----------SSS%--%%%%%%%---#-----------|---####--##-----
|
||||||
|------------------------------t--------S-------|-T---|||--||----------------#---||||||||----#-------|----------------|---|||||----#-----------|--#####--##----#
|
|------------------------------t--------S-------|-T---|||--||----------------#---||||||||----#-------|----------------|---|||||----#-----------|--#####--##-----
|
||||||
|--------------------------tt--t-------SSS%%-SS-|-TT--|||--||----------------#--S|||||||S----#-------tt---------S-----|--S||||S----#-----------|-######--##----#
|
|--------------------------tt--t-------SSS%%-SS-|-TT--|||--||----------------#--S|||||||S----#-------tt---------S-----|--S||||S----#-----------|-######--##-----
|
||||||
|--------k-------g---------tt-kt----------||----|-TT--|||--||----kkg-------###---|||||||---------g---tt------ggg------|---||||-----#-#---------|#######--##----#
|
|--------k-------g---------tt-kt----------||----|-TT--|||--||----kkg-------###---|||||||---------g---tt------ggg------|---||||-----#-#---------|#######--##-----
|
||||||
XX-------XXXXXXXXXXXXXXXXXXXXXXXS--%------%%----|XXXX-|||--||---XXXXXXXXXXXXXXXX%|%%%%%%%-------XXXXXXXXXXXXXXXX-%%%%%%%%%%%||--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
|
XX-------XXXXXXXXXXXXXXXXXXXXXXXS--%------%%----|XXXX-|||--||---XXXXXXXXXXXXXXXX%|%%%%%%%-------XXXXXXXXXXXXXXXX-%%%%%%%%%%%||--XXXXXXXXXXXXXXXXXXXXXXXXXXXX----
|
||||||
XX-------XXXXXXXXXXXXXXXXXXXXXXX---|------||----|XXXX-|||--||---XXXXXXXXXXXXXXXXg|-|||||--------XXXXXXXXXXXXXXXXg-|||||||||-||--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
|
XX-------XXXXXXXXXXXXXXXXXXXXXXX---|------||----|XXXX-|||--||---XXXXXXXXXXXXXXXXg|-|||||--------XXXXXXXXXXXXXXXXg-|||||||||-||--XXXXXXXXXXXXXXXXXXXXXXXXXXXX----
|
||||||
|
Binary file not shown.
@ -24,8 +24,7 @@ public class Play {
|
|||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
||||||
//FIXME: Debug Use
|
//FIXME: Debug Use
|
||||||
//playGameMain("lvl1");
|
// game = new MarioGame();
|
||||||
// initialGame();
|
|
||||||
// playJavaGame();
|
// playJavaGame();
|
||||||
System.out.println("Java: Play Java Main Function Done");
|
System.out.println("Java: Play Java Main Function Done");
|
||||||
}
|
}
|
||||||
|
@ -144,6 +144,7 @@ public class MarioGame extends KeyAdapter{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private MarioResult gameLoop(String level, int timer, int marioState, boolean visual, int fps, String resultPath, int col) {
|
private MarioResult gameLoop(String level, int timer, int marioState, boolean visual, int fps, String resultPath, int col) {
|
||||||
|
|
||||||
this.world = new MarioWorld(this.killEvents);
|
this.world = new MarioWorld(this.killEvents);
|
||||||
this.world.visuals = visual;
|
this.world.visuals = visual;
|
||||||
this.world.initializeLevel(level, 1000 * timer);
|
this.world.initializeLevel(level, 1000 * timer);
|
||||||
@ -153,7 +154,8 @@ public class MarioGame extends KeyAdapter{
|
|||||||
this.world.lives = this.initialLives;
|
this.world.lives = this.initialLives;
|
||||||
this.world.mario.isLarge = marioState > 0;
|
this.world.mario.isLarge = marioState > 0;
|
||||||
this.world.mario.isFire = marioState > 1;
|
this.world.mario.isFire = marioState > 1;
|
||||||
this.world.update(new boolean[MarioActions.numberOfActions()]);
|
|
||||||
|
|
||||||
long currentTime = System.currentTimeMillis();
|
long currentTime = System.currentTimeMillis();
|
||||||
|
|
||||||
//initialize graphics
|
//initialize graphics
|
||||||
@ -221,6 +223,7 @@ public class MarioGame extends KeyAdapter{
|
|||||||
|
|
||||||
// update world
|
// update world
|
||||||
this.world.update(actions);
|
this.world.update(actions);
|
||||||
|
//System.out.println((int) this.world.mario.y / 16);
|
||||||
gameEvents.addAll(this.world.lastFrameEvents);
|
gameEvents.addAll(this.world.lastFrameEvents);
|
||||||
agentEvents.add(new MarioAgentEvent(actions, this.world.mario.x,
|
agentEvents.add(new MarioAgentEvent(actions, this.world.mario.x,
|
||||||
this.world.mario.y, (this.world.mario.isLarge ? 1 : 0) + (this.world.mario.isFire ? 1 : 0),
|
this.world.mario.y, (this.world.mario.isLarge ? 1 : 0) + (this.world.mario.isFire ? 1 : 0),
|
||||||
|
@ -234,16 +234,22 @@ public class MarioWorld {
|
|||||||
public void revive() {
|
public void revive() {
|
||||||
int newTileX = (int) this.mario.x / 16;
|
int newTileX = (int) this.mario.x / 16;
|
||||||
int newTileY = (int) this.mario.y / 16;
|
int newTileY = (int) this.mario.y / 16;
|
||||||
|
int direction = 1;
|
||||||
try {
|
try {
|
||||||
l: while (true) {
|
l: while (true) {
|
||||||
//System.out.println(newTileX);
|
if(newTileX<this.level.tileWidth){
|
||||||
for (int y = this.level.tileHeight - 2; y >= 8; y--) {
|
//for (int y = this.level.tileHeight-2; y >= 8; y--) {
|
||||||
if (this.level.standable(newTileX, y)) {
|
for (int y = 0; y <= this.level.tileHeight-2; y++) {
|
||||||
newTileY = y;
|
if (this.level.standable(newTileX, y)) {
|
||||||
break l;
|
newTileY = y;
|
||||||
|
break l;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
newTileX+=direction;
|
||||||
|
}else{
|
||||||
|
direction = -1;
|
||||||
|
newTileX = (int) this.mario.x / 16;
|
||||||
}
|
}
|
||||||
newTileX++;
|
|
||||||
}
|
}
|
||||||
} catch (ArrayIndexOutOfBoundsException e) {
|
} catch (ArrayIndexOutOfBoundsException e) {
|
||||||
this.lose();
|
this.lose();
|
||||||
|
3
main.py
3
main.py
@ -15,7 +15,7 @@ print = logging.getLogger().info
|
|||||||
|
|
||||||
app = Flask(__name__, static_folder='')
|
app = Flask(__name__, static_folder='')
|
||||||
idm = idManager()
|
idm = idManager()
|
||||||
app.secret_key = 'fkdjsafjdkfdlkjfadskjfadskljdsfklj'
|
app.secret_key = 'asdfasdfawefaewvaf'
|
||||||
replayDataPath = "reps/"
|
replayDataPath = "reps/"
|
||||||
evalDataPath = "evals/"
|
evalDataPath = "evals/"
|
||||||
|
|
||||||
@ -31,6 +31,7 @@ def getId():
|
|||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def gamewelcome():
|
def gamewelcome():
|
||||||
|
ip = getId()
|
||||||
# return redirect(url_for('gameplay', id=request.remote_addr))
|
# return redirect(url_for('gameplay', id=request.remote_addr))
|
||||||
return render_template('GameWelcome.html')
|
return render_template('GameWelcome.html')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user