Time.delta cleanup / Basic mobile input

This commit is contained in:
Anuken
2020-07-19 12:21:21 -04:00
parent f9ed74c15a
commit a074010eb7
91 changed files with 414 additions and 247 deletions

View File

@@ -116,7 +116,7 @@ public class LoadRenderer implements Disposable{
//preview : no frametime
if(preview){
testprogress += Time.delta() / (60f * 3);
testprogress += Time.delta / (60f * 3);
progress = testprogress;
if(input.keyTap(KeyCode.space)){
testprogress = 0;

View File

@@ -206,7 +206,7 @@ public class MenuRenderer implements Disposable{
}
public void render(){
time += Time.delta();
time += Time.delta;
float scaling = Math.max(Scl.scl(4f), Math.max(Core.graphics.getWidth() / ((width - 1f) * tilesize), Core.graphics.getHeight() / ((height - 1f) * tilesize)));
camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling,

View File

@@ -129,7 +129,7 @@ public class OverlayRenderer{
//draw selected block
if(input.block == null && !Core.scene.hasMouse()){
Vec2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY());
Building tile = world.entWorld(vec.x, vec.y);
Building tile = world.buildWorld(vec.x, vec.y);
if(tile != null && tile.team() == player.team()){
tile.drawSelect();
@@ -152,7 +152,7 @@ public class OverlayRenderer{
Lines.circle(v.x, v.y, 6 + Mathf.absin(Time.time(), 5f, 1f));
Draw.reset();
Building tile = world.entWorld(v.x, v.y);
Building tile = world.buildWorld(v.x, v.y);
if(tile != null && tile.interactable(player.team()) && tile.acceptStack(player.unit().item(), player.unit().stack.amount, player.unit()) > 0){
Lines.stroke(3f, Pal.gray);
Lines.square(tile.x, tile.y, tile.block().size * tilesize / 2f + 3 + Mathf.absin(Time.time(), 5f, 1f));