Less messy respawning / Standard starter mech / Bugfixes

This commit is contained in:
Anuken
2019-04-28 10:34:53 -04:00
parent ad13c83f93
commit 4c17b56e28
25 changed files with 2310 additions and 2352 deletions

View File

@@ -22,6 +22,7 @@ public enum Binding implements KeyBind{
zoom(new Axis(KeyCode.SCROLL)),
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE),
pause(KeyCode.SPACE),
minimap(KeyCode.M),
toggle_menus(KeyCode.C),
screenshot(KeyCode.P),
player_list(KeyCode.TAB, "multiplayer"),

View File

@@ -130,6 +130,14 @@ public class DesktopInput extends InputHandler{
player.isShooting = false;
}
if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap)){
if(!ui.minimap.isShown()){
ui.minimap.show();
}else{
ui.minimap.hide();
}
}
if(state.is(State.menu) || Core.scene.hasDialog()) return;
//zoom and rotate things

View File

@@ -734,9 +734,11 @@ public class MobileInput extends InputHandler implements GestureListener{
if(player.isDead()) return;
Vector2 v = Core.camera.position;
//change to 1/2 to clamp to viewport
float scaling = 1f;
v.x = clerp(v.x, player.x - Core.camera.width/2f, player.x + Core.camera.width/2f);
v.y = clerp(v.y, player.y - Core.camera.height/2f, player.y + Core.camera.height/2f);
v.x = clerp(v.x, player.x - Core.camera.width*scaling, player.x + Core.camera.width*scaling);
v.y = clerp(v.y, player.y - Core.camera.height*scaling, player.y + Core.camera.height*scaling);
}
float clerp(float value, float min, float max){