mirror of
https://github.com/fazo96/AIrium.git
synced 2025-01-10 09:34:20 +01:00
formatting
This commit is contained in:
parent
c37675d7b3
commit
2d6b8955f1
@ -57,7 +57,7 @@ public class Game extends ApplicationAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public boolean touchDragged(int i, int i1, int i2) {
|
public boolean touchDragged(int i, int i1, int i2) {
|
||||||
//renderer.translate(Gdx.input.getDeltaX(), -Gdx.input.getDeltaY(), 0);
|
//renderer.translate(Gdx.input.getDeltaX(), -Gdx.input.getDeltaY(), 0);
|
||||||
camera.translate(-Gdx.input.getDeltaX()*camera.zoom, Gdx.input.getDeltaY()*camera.zoom);
|
camera.translate(-Gdx.input.getDeltaX() * camera.zoom, Gdx.input.getDeltaY() * camera.zoom);
|
||||||
camera.update();
|
camera.update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -77,10 +77,13 @@ public class Game extends ApplicationAdapter {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
camera.zoom += i;
|
camera.zoom += i;
|
||||||
if(camera.zoom < 1f) camera.zoom = 1f;
|
if (camera.zoom < 1f) {
|
||||||
else if(camera.zoom > 10) camera.zoom = 10;
|
camera.zoom = 1f;
|
||||||
|
} else if (camera.zoom > 10) {
|
||||||
|
camera.zoom = 10;
|
||||||
|
}
|
||||||
camera.update();
|
camera.update();
|
||||||
Log.log(Log.DEBUG, "Camera zoom: "+camera.zoom+" Delta: "+i);
|
Log.log(Log.DEBUG, "Camera zoom: " + camera.zoom + " Delta: " + i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -102,13 +105,13 @@ public class Game extends ApplicationAdapter {
|
|||||||
this(new World(null));
|
this(new World(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Game(World world){
|
public Game(World world) {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
world.start();
|
world.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resize(int width, int height){
|
public void resize(int width, int height) {
|
||||||
camera.setToOrtho(false, width, height);
|
camera.setToOrtho(false, width, height);
|
||||||
camera.update();
|
camera.update();
|
||||||
}
|
}
|
||||||
@ -132,9 +135,11 @@ public class Game extends ApplicationAdapter {
|
|||||||
// Render only half the elements because the list gets
|
// Render only half the elements because the list gets
|
||||||
// modified by another thread? Who cares, it's a simulation
|
// modified by another thread? Who cares, it's a simulation
|
||||||
// not some videogame
|
// not some videogame
|
||||||
|
Log.log(Log.DEBUG, "Failed to complete rendering");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ConcurrentModificationException ex) {
|
} catch (ConcurrentModificationException ex) {
|
||||||
|
Log.log(Log.DEBUG, "Failed to complete rendering");
|
||||||
}
|
}
|
||||||
renderer.setColor(0.3f, 0.3f, 0.3f, 1);
|
renderer.setColor(0.3f, 0.3f, 0.3f, 1);
|
||||||
// draw borders
|
// draw borders
|
||||||
|
Loading…
Reference in New Issue
Block a user