added maprenderer
This commit is contained in:
@@ -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
|
* Map class to hold a 2d array of tiles which will specify the map
|
||||||
42
core/src/netwerkprog/game/client/map/MapRenderer.java
Normal file
42
core/src/netwerkprog/game/client/map/MapRenderer.java
Normal 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
package netwerkprog.game.util;
|
package netwerkprog.game.util;
|
||||||
|
|
||||||
public interface Drawable extends Updatable {
|
public interface Renderable extends Updatable {
|
||||||
void render();
|
void render();
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import netwerkprog.game.client.Map;
|
import netwerkprog.game.client.map.Map;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user