master
GammelJan 6 years ago
parent 0bbf6e1c4c
commit 07d6c433ce

@ -41,7 +41,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
batch = new SpriteBatch(); batch = new SpriteBatch();
Gdx.input.setInputProcessor(this); 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 = new Timer();
stepTimer.scheduleTask(new Timer.Task() { stepTimer.scheduleTask(new Timer.Task() {
@ -108,6 +108,13 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
} }
} }
else if(gs != null){ 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; return true;
} }

@ -56,12 +56,12 @@ public class Level {
} }
private void stepPivot(){ private void stepPivot(){
angleSpeed += 0.001; angleSpeed += 0.0001;
angle += angleSpeed; angle += angleSpeed;
Vector2 newPosVector = math.pivotGetNewPos(this.angle, this.xPosPivot, this.yPosPivot, RADIUS); Vector2 newPosVector = math.pivotGetNewPos(this.angle, this.xPosPivot, this.yPosPivot, RADIUS);
this.projectile.setxPos((int) newPosVector.x); this.projectile.setxPos(xPosPivot + (int) newPosVector.x);
this.projectile.setyPos((int) newPosVector.y); this.projectile.setyPos(yPosPivot + (int) newPosVector.y);
} }
private void stepAir(){ private void stepAir(){
@ -83,4 +83,7 @@ public class Level {
public int getPivotY(){ public int getPivotY(){
return yPosPivot; return yPosPivot;
} }
public boolean released(){
return isReleased;
}
} }

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

Loading…
Cancel
Save