Sector edges

This commit is contained in:
Anuken
2018-11-02 20:53:08 -04:00
4 changed files with 114 additions and 11 deletions

View File

@@ -124,7 +124,7 @@ public class Control extends Module{
Events.on(WorldLoadGraphicsEvent.class, event -> {
if(mobile){
Core.camera.position.set(players[0].x, players[0].y, 0);
Gdx.app.postRunnable(() -> Core.camera.position.set(players[0].x, players[0].y, 0));
}
});

View File

@@ -574,13 +574,14 @@ public class MobileInput extends InputHandler implements GestureListener{
consumed = true;
player.dropCarry(); //drop off unit
}else{
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
threads.run(() -> {
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
if(unit != null){
player.moveTarget = unit;
consumed = true;
Effects.effect(Fx.select, unit.getX(), unit.getY());
}
if(unit != null){
player.moveTarget = unit;
Effects.effect(Fx.select, unit.getX(), unit.getY());
}
});
}
}