Main model almost finished

master
Jonathan Hager 5 years ago
parent 0ca67870d6
commit e0db7cc0e8

@ -7,15 +7,31 @@ import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.utils.Timer;
import com.trs.game.model.Model;
import com.trs.game.view.View;
public class Controller extends ApplicationAdapter { public class Controller extends ApplicationAdapter {
SpriteBatch batch; SpriteBatch batch;
ShapeRenderer renderer; ShapeRenderer renderer;
Timer wallTimer;
Model model;
View view;
@Override @Override
public void create () { public void create () {
batch = new SpriteBatch(); batch = new SpriteBatch();
renderer = new ShapeRenderer(); renderer = new ShapeRenderer();
model = new Model();
view = new View();
wallTimer = new Timer();
wallTimer.scheduleTask(new Timer.Task() {
@Override
public void run() {
// TODO: Implement timertask
}
}, 0, 1f);
} }
@Override @Override

@ -0,0 +1,4 @@
package com.trs.game;
public class StaticMath {
}

@ -1,4 +1,18 @@
package com.trs.game.model; package com.trs.game.model;
import java.util.ArrayList;
public class Model { public class Model {
private Monster monster;
private ArrayList<Wall> walls;
public Model(){
monster = new Monster();
walls = new ArrayList<>();
}
public void timerStep(){
}
} }

@ -0,0 +1,35 @@
package com.trs.game.model;
import com.badlogic.gdx.math.Rectangle;
public class PermWall implements Wall {
private double rotation;
private Rectangle rect;
public PermWall(double rotation, Rectangle rect){
this.rotation = rotation;
this.rect = rect;
}
@Override
public Wall timerStep() {
return this;
}
public double getRotation() {
return rotation;
}
public void setRotation(double rotation) {
this.rotation = rotation;
}
public Rectangle getRect() {
return rect;
}
public void setRect(Rectangle rect) {
this.rect = rect;
}
}

@ -0,0 +1,4 @@
package com.trs.game.model;
public class Projectile {
}

@ -0,0 +1,46 @@
package com.trs.game.model;
import com.badlogic.gdx.math.Rectangle;
public class TempWall implements Wall {
private double rotation;
private Rectangle rect;
private int lifetime;
public TempWall(double rotation, Rectangle rect, int lifetime){
this.rotation = rotation;
this.rect = rect;
this.lifetime = lifetime;
}
@Override
public Wall timerStep() {
return null;
}
public double getRotation() {
return rotation;
}
public void setRotation(double rotation) {
this.rotation = rotation;
}
public Rectangle getRect() {
return rect;
}
public void setRect(Rectangle rect) {
this.rect = rect;
}
public int getLifetime() {
return lifetime;
}
public void setLifetime(int lifetime) {
this.lifetime = lifetime;
}
}

@ -0,0 +1,5 @@
package com.trs.game.model;
public interface Wall {
public Wall timerStep();
}

@ -7,7 +7,7 @@ public class View {
Rectangle r; Rectangle r;
Polygon p; Polygon p;
View(){ public View(){
} }
} }

Loading…
Cancel
Save