mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 23:11:12 -08:00
More movement
This commit is contained in:
parent
4265d40024
commit
8a9c92227d
4 changed files with 13 additions and 8 deletions
|
|
@ -163,9 +163,8 @@ public class DesktopInput extends InputHandler{
|
|||
}
|
||||
}
|
||||
|
||||
//TODO implement
|
||||
if(!player.dead()){
|
||||
updateKeyboard(player.unit());
|
||||
if(!player.dead() && !state.isPaused()){
|
||||
updateMovement(player.unit());
|
||||
}
|
||||
|
||||
if(Core.input.keyRelease(Binding.select)){
|
||||
|
|
@ -179,7 +178,8 @@ public class DesktopInput extends InputHandler{
|
|||
if(state.is(State.menu) || Core.scene.hasDialog()) return;
|
||||
|
||||
//zoom camera
|
||||
if((!Core.scene.hasScroll() || Core.input.keyDown(Binding.diagonal_placement)) && !ui.chatfrag.shown() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||
if((!Core.scene.hasScroll() || Core.input.keyDown(Binding.diagonal_placement)) && !ui.chatfrag.shown() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0
|
||||
&& !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ public class DesktopInput extends InputHandler{
|
|||
}
|
||||
}
|
||||
|
||||
protected void updateKeyboard(Unitc unit){
|
||||
protected void updateMovement(Unitc unit){
|
||||
boolean canMove = !(Core.scene.getKeyboardFocus() instanceof TextField);
|
||||
|
||||
float speed = unit.type().speed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue