Projectile move added

master
Jonathan Hager 5 years ago
parent b314df5677
commit 5d7efe4ddf

@ -46,7 +46,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor {
wallTimer.scheduleTask(new Timer.Task() { wallTimer.scheduleTask(new Timer.Task() {
@Override @Override
public void run() { public void run() {
// TODO: Implement timertask model.timerStep();
} }
}, 0, 1f); }, 0, 1f);
font = new BitmapFont(); font = new BitmapFont();
@ -90,6 +90,14 @@ public class Controller extends ApplicationAdapter implements InputProcessor {
renderer.dispose(); renderer.dispose();
} }
public void timerStart(){
wallTimer.start();
}
public void timerStop(){
wallTimer.stop();
}
@Override @Override
public boolean keyDown(int keycode) { public boolean keyDown(int keycode) {
return false; return false;

@ -8,15 +8,22 @@ import java.util.ArrayList;
public class Model { public class Model {
private Monster monster; private Monster monster;
private ArrayList<Wall> walls; private ArrayList<Wall> walls;
private ArrayList<Projectile> projectiles;
public Model(){ public Model(){
monster = new Monster(250,150); monster = new Monster(250,150);
walls = new ArrayList<>(); walls = new ArrayList<>();
walls.add(new PermWall(20,new Rectangle(250,250,50,25))); walls.add(new PermWall(20,new Rectangle(250,250,50,25)));
projectiles = new ArrayList<>();
} }
public void timerStep(){ public void timerStep(){
monster.move();
for(Projectile projectile : projectiles){
projectile.move();
}
} }
public ArrayList<Wall> getWalls(){ public ArrayList<Wall> getWalls(){

Loading…
Cancel
Save