diff --git a/android/assets/vanishBottom.png b/android/assets/vanishBottom.png new file mode 100644 index 0000000..0636382 Binary files /dev/null and b/android/assets/vanishBottom.png differ diff --git a/android/assets/vanishLeft.png b/android/assets/vanishLeft.png new file mode 100644 index 0000000..b25cc69 Binary files /dev/null and b/android/assets/vanishLeft.png differ diff --git a/android/assets/vanishRight.png b/android/assets/vanishRight.png new file mode 100644 index 0000000..79c4579 Binary files /dev/null and b/android/assets/vanishRight.png differ diff --git a/core/src/controller/Controller.java b/core/src/controller/Controller.java index ceef125..0e7ee82 100644 --- a/core/src/controller/Controller.java +++ b/core/src/controller/Controller.java @@ -9,7 +9,10 @@ import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.graphics.g2d.TextureRegion; import model.Goal; import model.Level; import model.Projectile; @@ -41,13 +44,18 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ batch = new SpriteBatch(); Gdx.input.setInputProcessor(this); - level = new Level(new Goal(1000,500,200,150), new Projectile(0,0,0),400,400); + level = new Level(new Goal(1300,700,200,80), new Projectile(0,0,0),400,400); stepTimer = new Timer(); stepTimer.scheduleTask(new Timer.Task() { @Override public void run() { - level.step(); + if(level.getProjectile().getxPos() > Gdx.graphics.getWidth() || level.getProjectile().getxPos() < 0 || level.getProjectile().getyPos() < 0){ + level.reset(); + } + else{ + level.step(); + } } }, 0, 0.01f); stepTimer.stop(); diff --git a/core/src/model/Level.java b/core/src/model/Level.java index 6115b64..585c6b4 100644 --- a/core/src/model/Level.java +++ b/core/src/model/Level.java @@ -14,7 +14,7 @@ import com.throwgame.main.ThrowMath; */ public class Level { private final double G = 0.05; - private final int RADIUS = 100; + private final int RADIUS = 150; private Goal goal; private Projectile projectile; @@ -79,6 +79,14 @@ public class Level { System.out.println(projectile.getxPos() + " " + projectile.getyPos()); */ } + + public void reset(){ + isReleased = false; + projectile.setxPos(xPosPivot + RADIUS); + projectile.setyPos(yPosPivot); + angle = 0; + angleSpeed = 0; + } public Goal getGoal() { return goal; diff --git a/desktop/src/com/throwgame/main/desktop/DesktopLauncher.java b/desktop/src/com/throwgame/main/desktop/DesktopLauncher.java index b7cffc6..01ea9bb 100644 --- a/desktop/src/com/throwgame/main/desktop/DesktopLauncher.java +++ b/desktop/src/com/throwgame/main/desktop/DesktopLauncher.java @@ -9,8 +9,8 @@ public class DesktopLauncher { public static void main (String[] arg) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); //config.fullscreen = true; - config.height = 720; - config.width = 1280; + config.height = 900; + config.width = 1600; new LwjglApplication(new Controller(), config); } }