Fixed some Android bugs

This commit is contained in:
Anuken 2017-07-16 17:10:17 -04:00
parent c3712d6f78
commit ed6b49788d
3 changed files with 8 additions and 2 deletions

View File

@ -21,7 +21,8 @@ public class Vars{
//not marked as final, because of warnings
public static boolean debug = false;
public static final int multiplier = android ? 2 : 1;
//turret and enemy shoot speed inverse multiplier
public static final int multiplier = android ? 3 : 1;
public static final int tilesize = 8;

View File

@ -155,7 +155,9 @@ public class World{
return false;
}
}
return tile(x, y).block() == Blocks.air;
Tile tile = tile(x, y);
return tile != null && tile.block() == Blocks.air;
}
public static boolean cursorNear(){

View File

@ -119,6 +119,9 @@ public class AndroidInput extends InputAdapter{
lmousex = Gdx.input.getX(0);
lmousey = Gdx.input.getY(0);
player.breaktime = 0;
mousex = Mathf.clamp(mousex, 0, Gdx.graphics.getWidth());
mousey = Mathf.clamp(mousey, 0, Gdx.graphics.getHeight());
}
}