Fixed create and removed souts
This commit is contained in:
@@ -92,15 +92,11 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
screenHeight = Gdx.graphics.getHeight();
|
screenHeight = Gdx.graphics.getHeight();
|
||||||
frameRate = new FrameRate();
|
frameRate = new FrameRate();
|
||||||
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
|
||||||
camera.position.set(screenWidth / 2, screenHeight / 2, 0);
|
textRenderer = new TextRenderer();
|
||||||
camera.viewportWidth = screenWidth / 2;
|
|
||||||
camera.viewportHeight = screenHeight / 2;
|
|
||||||
camera.update();
|
|
||||||
gameInputProcessor = new GameInputProcessor(camera);
|
|
||||||
batch = new SpriteBatch();
|
|
||||||
font = new BitmapFont();
|
font = new BitmapFont();
|
||||||
layout = new GlyphLayout();
|
layout = new GlyphLayout();
|
||||||
textRenderer = new TextRenderer();
|
assets = new AssetManager();
|
||||||
|
|
||||||
String[] strings = new String[]{
|
String[] strings = new String[]{
|
||||||
"#########################",
|
"#########################",
|
||||||
"#xxxx # #",
|
"#xxxx # #",
|
||||||
@@ -117,13 +113,16 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
"#########################"
|
"#########################"
|
||||||
};
|
};
|
||||||
map = new Map(strings);
|
map = new Map(strings);
|
||||||
mapRenderer = new MapRenderer(map, 32, batch, camera);
|
gameInputProcessor = new GameInputProcessor(camera);
|
||||||
assets = new AssetManager();
|
|
||||||
screenWidth = Gdx.graphics.getWidth();
|
|
||||||
screenHeight = Gdx.graphics.getHeight();
|
|
||||||
Gdx.input.setInputProcessor(gameInputProcessor);
|
Gdx.input.setInputProcessor(gameInputProcessor);
|
||||||
|
mapRenderer = new MapRenderer(map, 32, batch, camera);
|
||||||
|
camera.position.set(screenWidth / 2, screenHeight / 2, 0);
|
||||||
|
camera.viewportWidth = screenWidth / 2;
|
||||||
|
camera.viewportHeight = screenHeight / 2;
|
||||||
|
camera.update();
|
||||||
|
setGamestate(GAMESTATE.SELECTING_FACTION);
|
||||||
|
connectToServer();
|
||||||
playSong();
|
playSong();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -106,11 +106,9 @@ public class Client implements Runnable {
|
|||||||
* @param in The inputStream
|
* @param in The inputStream
|
||||||
*/
|
*/
|
||||||
public void receive(ObjectInputStream in) {
|
public void receive(ObjectInputStream in) {
|
||||||
System.out.println("[CLIENT RECEIVE] connected: " + isConnected);
|
|
||||||
while (isConnected) {
|
while (isConnected) {
|
||||||
try {
|
try {
|
||||||
Object object = in.readObject();
|
Object object = in.readObject();
|
||||||
System.out.println("[CLIENT] got object " + object);
|
|
||||||
if (object instanceof Data) {
|
if (object instanceof Data) {
|
||||||
callback.onDataReceived((Data) object);
|
callback.onDataReceived((Data) object);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user