Jan Ehehalt 6 years ago
parent 07c1bdf94e
commit a824ed5930

@ -17,6 +17,7 @@ import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.utils.Json;
import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.viewport.ExtendViewport;
import com.badlogic.gdx.utils.viewport.FillViewport;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.StretchViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
@ -82,7 +83,12 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
float aspectRatio = (float)Gdx.graphics.getHeight() / (float)Gdx.graphics.getWidth();
camera = new OrthographicCamera();
viewport = new StretchViewport(GAME_WORLD_WIDTH/* *aspectRatio*/, GAME_WORLD_HEIGHT, camera);
//if(aspectRatio == (9f/16f)){
// viewport = new StretchViewport(GAME_WORLD_WIDTH/* *aspectRatio*/, GAME_WORLD_HEIGHT, camera);
//}
//else{
viewport = new FitViewport(GAME_WORLD_WIDTH, GAME_WORLD_HEIGHT, camera);
//}
viewport.apply();
camera.position.set(GAME_WORLD_WIDTH/2, GAME_WORLD_HEIGHT/2, 0);

@ -87,13 +87,11 @@ public class Gamescreen{
goalRects[6] = new Rectangle(x + w-1 ,y ,1 ,h );
goalRects[7] = new Rectangle(x ,y ,w ,1 );
if(objects != null) {
for (Rectangle object : objects) {
objectRects.add(new Rectangle(object.getX(), object.getY(), 1, object.getHeight()));
objectRects.add(new Rectangle(object.getX(), object.getY() + object.getHeight() - 1, object.getWidth(), 1));
objectRects.add(new Rectangle(object.getX() + object.getWidth() - 1, object.getY(), 1, object.getHeight()));
objectRects.add(new Rectangle(object.getX(), object.getY(), object.getWidth(), 1));
}
for (Rectangle object : objects) {
objectRects.add(new Rectangle(object.getX(), object.getY(), 1, object.getHeight()));
objectRects.add(new Rectangle(object.getX(), object.getY() + object.getHeight() - 1, object.getWidth(), 1));
objectRects.add(new Rectangle(object.getX() + object.getWidth() - 1, object.getY(), 1, object.getHeight()));
objectRects.add(new Rectangle(object.getX(), object.getY(), object.getWidth(), 1));
}
goalRect = new Rectangle(x + w*th, y + h*th, w * th * 3, h * 0.1f);

@ -8,9 +8,9 @@ import controller.Controller;
public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
//config.fullscreen = true;
config.height = 720;
config.width = 1280;
config.fullscreen = true;
config.height = 2560;
config.width = 3840;
new LwjglApplication(new Controller(), config);
}
}

@ -1 +1 @@
{goal:{xPos:1556,yPos:774,sizeX:300,sizeY:200,thickness:0.2},projectile:{xPos:698,yPos:677,mass:5,radius:10},math:{},xPosPivot:698,yPosPivot:527,isTraceInitialised:[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],traces:[{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10}],objects:[{x:590,y:705,width:200,height:100},{x:705,y:690,width:200,height:100},{x:816,y:628,width:200,height:100},{x:896,y:557,width:200,height:100},{x:908,y:478,width:200,height:100},{x:902,y:380,width:200,height:100},{x:833,y:269,width:200,height:100},{x:880,y:325,width:200,height:100},{x:720,y:237,width:200,height:100},{x:596,y:245,width:200,height:100},{x:458,y:269,width:200,height:100},{x:356,y:367,width:200,height:100},{x:312,y:538,width:200,height:100},{x:287,y:459,width:200,height:100},{x:340,y:630,width:200,height:100},{x:410,y:697,width:200,height:100}]}
{goal:{xPos:1126,yPos:430,sizeX:300,sizeY:200,thickness:0.2},projectile:{xPos:528,yPos:629,mass:5,radius:10},math:{},xPosPivot:528,yPosPivot:479,isTraceInitialised:[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],traces:[{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10},{x:-10,y:-10}],objects:[{x:464,y:556,width:200,height:100}]}
Loading…
Cancel
Save