Jonathan Hager 6 years ago
commit 4d0534dbc6

@ -6,11 +6,8 @@
package controller; package controller;
import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import model.Goal; import model.Goal;
@ -18,6 +15,7 @@ import model.Level;
import model.Projectile; import model.Projectile;
import view.Gamescreen; import view.Gamescreen;
import view.Levelscreen; import view.Levelscreen;
import com.badlogic.gdx.utils.Timer;
import view.Titlescreen; import view.Titlescreen;
/** /**
@ -31,6 +29,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
Gamescreen gs; Gamescreen gs;
int levelAmount; int levelAmount;
SpriteBatch batch; SpriteBatch batch;
Timer stepTimer;
@Override @Override
public void create(){ public void create(){
@ -40,6 +39,14 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
levelAmount = 10; levelAmount = 10;
batch = new SpriteBatch(); batch = new SpriteBatch();
Gdx.input.setInputProcessor(this); Gdx.input.setInputProcessor(this);
stepTimer = new Timer();
stepTimer.scheduleTask(new Timer.Task() {
@Override
public void run() {
}
}, 0, 0.1f);
} }
@Override @Override

@ -15,7 +15,7 @@ import com.throwgame.main.ThrowMath;
*/ */
public class Level { public class Level {
private final double G = 9.81; private final double G = 9.81;
private final int RADIUS = 5; private final int RADIUS = 50;
private Goal goal; private Goal goal;
private Projectile projectile; private Projectile projectile;
@ -29,6 +29,8 @@ public class Level {
public Level(Goal goal, Projectile projectile, int xPosPivot, int yPosPivot){ public Level(Goal goal, Projectile projectile, int xPosPivot, int yPosPivot){
this.goal = goal; this.goal = goal;
this.projectile = projectile; this.projectile = projectile;
this.projectile.setxPos(xPosPivot + RADIUS);
this.projectile.setyPos(yPosPivot);
this.math = new ThrowMath(); this.math = new ThrowMath();
this.isReleased = false; this.isReleased = false;

Loading…
Cancel
Save