Added basic enemy spawning, fixed turret base sprite, input place lag

This commit is contained in:
Anuken
2018-05-21 15:03:34 -04:00
parent 4a250b4e27
commit 5602cb8920
15 changed files with 515 additions and 517 deletions

View File

@@ -20,6 +20,7 @@ import static io.anuke.mindustry.Vars.*;
public class DesktopInput extends InputHandler{
float mousex, mousey;
float endx, endy;
float prmousex, prmousey;
private float controlx, controly;
private boolean beganBreak;
private boolean controlling;
@@ -34,8 +35,8 @@ public class DesktopInput extends InputHandler{
@Override public float getCursorEndX(){ return endx; }
@Override public float getCursorEndY(){ return endy; }
@Override public float getCursorX(){ return Graphics.screen(mousex, mousey).x; }
@Override public float getCursorY(){ return Gdx.graphics.getHeight() - 1 - Graphics.screen(mousex, mousey).y; }
@Override public float getCursorX(){ return prmousex; }
@Override public float getCursorY(){ return prmousey; }
@Override public boolean drawPlace(){ return !beganBreak; }
@Override
@@ -82,6 +83,9 @@ public class DesktopInput extends InputHandler{
endx = getMouseX();
endy = getMouseY();
prmousex = Graphics.screen(mousex, mousey).x;
prmousey = Gdx.graphics.getHeight() - 1 - Graphics.screen(mousex, mousey).y;
boolean controller = KeyBinds.getSection(section).device.type == DeviceType.controller;
if(Inputs.getAxisActive("zoom") && (Inputs.keyDown(section,"zoom_hold") || controller)