added maprenderer

This commit is contained in:
Sem van der Hoeven
2020-05-15 19:51:40 +02:00
parent 162b5e74cd
commit a8fe07b5c0
4 changed files with 45 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
package netwerkprog.game.client;
package netwerkprog.game.client.map;
/**
* Map class to hold a 2d array of tiles which will specify the map

View File

@@ -0,0 +1,42 @@
package netwerkprog.game.client.map;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import netwerkprog.game.util.Renderable;
public class MapRenderer implements Renderable {
private int tileWidth;
private Map map;
public MapRenderer(Map map, int tileWidth) {
this.map = map;
this.tileWidth = tileWidth;
}
public int getTileWidth() {
return tileWidth;
}
public Map getMap() {
return map;
}
public void setTileWidth(int tileWidth) {
this.tileWidth = tileWidth;
}
public void setMap(Map map) {
this.map = map;
}
@Override
public void render() {
Batch batch = new SpriteBatch();
}
@Override
public void update(double deltaTime) {
}
}

View File

@@ -1,5 +1,5 @@
package netwerkprog.game.util;
public interface Drawable extends Updatable {
public interface Renderable extends Updatable {
void render();
}

View File

@@ -1,4 +1,4 @@
import netwerkprog.game.client.Map;
import netwerkprog.game.client.map.Map;
import org.junit.Assert;
import org.junit.Test;