master
GammelJan 6 years ago
parent 0bbf6e1c4c
commit 07d6c433ce

@ -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;
}

@ -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;
}
}

@ -20,7 +20,7 @@ public class Projectile {
switch(type){
case 0:
mass = 5;
radius = 5;
radius = 10;
break;
}
}

Loading…
Cancel
Save