diff --git a/core/src/controller/Controller.java b/core/src/controller/Controller.java index 40e4f98..94138dc 100644 --- a/core/src/controller/Controller.java +++ b/core/src/controller/Controller.java @@ -41,7 +41,7 @@ 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(100,100,0),400,400); + level = new Level(new Goal(1000,500,200,150), new Projectile(0,0,0),400,400); stepTimer = new Timer(); stepTimer.scheduleTask(new Timer.Task() { @@ -108,6 +108,13 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ } } else if(gs != null){ + if(!level.released()){ + level.projectileReleased(); + } + System.out.println(level.getProjectile().getxPos()); + System.out.println(level.getProjectile().getyPos()); + //gs = null; + //ls = new Levelscreen(levelAmount); } return true; } diff --git a/core/src/model/Level.java b/core/src/model/Level.java index 25257e8..50776ca 100644 --- a/core/src/model/Level.java +++ b/core/src/model/Level.java @@ -56,12 +56,12 @@ public class Level { } private void stepPivot(){ - angleSpeed += 0.001; + angleSpeed += 0.0001; angle += angleSpeed; Vector2 newPosVector = math.pivotGetNewPos(this.angle, this.xPosPivot, this.yPosPivot, RADIUS); - this.projectile.setxPos((int) newPosVector.x); - this.projectile.setyPos((int) newPosVector.y); + this.projectile.setxPos(xPosPivot + (int) newPosVector.x); + this.projectile.setyPos(yPosPivot + (int) newPosVector.y); } private void stepAir(){ @@ -83,4 +83,7 @@ public class Level { public int getPivotY(){ return yPosPivot; } + public boolean released(){ + return isReleased; + } } diff --git a/core/src/model/Projectile.java b/core/src/model/Projectile.java index 6197b5c..3225c70 100644 --- a/core/src/model/Projectile.java +++ b/core/src/model/Projectile.java @@ -20,7 +20,7 @@ public class Projectile { switch(type){ case 0: mass = 5; - radius = 5; + radius = 10; break; } }