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-------
|
||||
----------o-----t-------------------------------------------------------------------SSSS--S----------------------SSSSSSSSSSSSSSS--------------------------------
|
||||
----------o-----t-----------------S-------------------------------------------------SSSS--S----------------------SSSSSSSSSSSSSSS--------------------------------
|
||||
%--------S------t--------------------------------------------------------------------SS--SSS--------------------SSSSSSSSSSSSSSS---------------------------------
|
||||
|------------------------------o----------SSSSSS--------------------Q--------------S------SS-------------------o------S----KSSS---------------@%--S-------------
|
||||
|-----------------------------------------SSSSS------oo----------------------------------------------%---------------------SS------------------|----------------
|
||||
|---------------------------------S-------SSSSS------oo----------------------------------------------%---------------------SS------------------|----------------
|
||||
|--------------------------------------SSSSSSSS-%----%%%%%-%%--------------------------SS------------|-----------------------------------------|-----#----------
|
||||
|--------o------------------------S--SS--SSSSS--|-----|||--||--------------------------r-------S-----|------------SSo-ooo---oSSS---------------|----##----------
|
||||
|------------------------------S----SSSSSSSSSSS-|-----|||--||-------------------%%%%%%%%%%------QQQ--|-QQ----------SSS%--%%%%%%%---#-----------|---####--##-##-#
|
||||
|------------------------------t--------S-------|-T---|||--||----------------#---||||||||----#-------|----------------|---|||||----#-----------|--#####--##----#
|
||||
|--------------------------tt--t-------SSS%%-SS-|-TT--|||--||----------------#--S|||||||S----#-------tt---------S-----|--S||||S----#-----------|-######--##----#
|
||||
|--------k-------g---------tt-kt----------||----|-TT--|||--||----kkg-------###---|||||||---------g---tt------ggg------|---||||-----#-#---------|#######--##----#
|
||||
XX-------XXXXXXXXXXXXXXXXXXXXXXXS--%------%%----|XXXX-|||--||---XXXXXXXXXXXXXXXX%|%%%%%%%-------XXXXXXXXXXXXXXXX-%%%%%%%%%%%||--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
|
||||
XX-------XXXXXXXXXXXXXXXXXXXXXXX---|------||----|XXXX-|||--||---XXXXXXXXXXXXXXXXg|-|||||--------XXXXXXXXXXXXXXXXg-|||||||||-||--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
|
||||
|------------------------------S----SSSSSSSSSSS-|-----|||--||-------------------%%%%%%%%%%------QQQ--|-QQ----------SSS%--%%%%%%%---#-----------|---####--##-----
|
||||
|------------------------------t--------S-------|-T---|||--||----------------#---||||||||----#-------|----------------|---|||||----#-----------|--#####--##-----
|
||||
|--------------------------tt--t-------SSS%%-SS-|-TT--|||--||----------------#--S|||||||S----#-------tt---------S-----|--S||||S----#-----------|-######--##-----
|
||||
|--------k-------g---------tt-kt----------||----|-TT--|||--||----kkg-------###---|||||||---------g---tt------ggg------|---||||-----#-#---------|#######--##-----
|
||||
XX-------XXXXXXXXXXXXXXXXXXXXXXXS--%------%%----|XXXX-|||--||---XXXXXXXXXXXXXXXX%|%%%%%%%-------XXXXXXXXXXXXXXXX-%%%%%%%%%%%||--XXXXXXXXXXXXXXXXXXXXXXXXXXXX----
|
||||
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 {
|
||||
|
||||
//FIXME: Debug Use
|
||||
//playGameMain("lvl1");
|
||||
// initialGame();
|
||||
// game = new MarioGame();
|
||||
// playJavaGame();
|
||||
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) {
|
||||
|
||||
this.world = new MarioWorld(this.killEvents);
|
||||
this.world.visuals = visual;
|
||||
this.world.initializeLevel(level, 1000 * timer);
|
||||
@ -153,7 +154,8 @@ public class MarioGame extends KeyAdapter{
|
||||
this.world.lives = this.initialLives;
|
||||
this.world.mario.isLarge = marioState > 0;
|
||||
this.world.mario.isFire = marioState > 1;
|
||||
this.world.update(new boolean[MarioActions.numberOfActions()]);
|
||||
|
||||
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
//initialize graphics
|
||||
@ -221,6 +223,7 @@ public class MarioGame extends KeyAdapter{
|
||||
|
||||
// update world
|
||||
this.world.update(actions);
|
||||
//System.out.println((int) this.world.mario.y / 16);
|
||||
gameEvents.addAll(this.world.lastFrameEvents);
|
||||
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),
|
||||
|
@ -234,16 +234,22 @@ public class MarioWorld {
|
||||
public void revive() {
|
||||
int newTileX = (int) this.mario.x / 16;
|
||||
int newTileY = (int) this.mario.y / 16;
|
||||
int direction = 1;
|
||||
try {
|
||||
l: while (true) {
|
||||
//System.out.println(newTileX);
|
||||
for (int y = this.level.tileHeight - 2; y >= 8; y--) {
|
||||
if (this.level.standable(newTileX, y)) {
|
||||
newTileY = y;
|
||||
break l;
|
||||
if(newTileX<this.level.tileWidth){
|
||||
//for (int y = this.level.tileHeight-2; y >= 8; y--) {
|
||||
for (int y = 0; y <= this.level.tileHeight-2; y++) {
|
||||
if (this.level.standable(newTileX, y)) {
|
||||
newTileY = y;
|
||||
break l;
|
||||
}
|
||||
}
|
||||
newTileX+=direction;
|
||||
}else{
|
||||
direction = -1;
|
||||
newTileX = (int) this.mario.x / 16;
|
||||
}
|
||||
newTileX++;
|
||||
}
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
this.lose();
|
||||
|
3
main.py
3
main.py
@ -15,7 +15,7 @@ print = logging.getLogger().info
|
||||
|
||||
app = Flask(__name__, static_folder='')
|
||||
idm = idManager()
|
||||
app.secret_key = 'fkdjsafjdkfdlkjfadskjfadskljdsfklj'
|
||||
app.secret_key = 'asdfasdfawefaewvaf'
|
||||
replayDataPath = "reps/"
|
||||
evalDataPath = "evals/"
|
||||
|
||||
@ -31,6 +31,7 @@ def getId():
|
||||
|
||||
@app.route('/')
|
||||
def gamewelcome():
|
||||
ip = getId()
|
||||
# return redirect(url_for('gameplay', id=request.remote_addr))
|
||||
return render_template('GameWelcome.html')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user