Closes #1 Fullført game så den lager ett brett med tiles + en robot

Main bruker nå GameLauncher istedet for GameBoard
This commit is contained in:
GabrielMagnus 2020-02-03 14:10:52 +01:00
parent 6a2a02d959
commit 4439e71dc5
2 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,6 @@
package inf112.skeleton.app;
import java.util.ArrayList;
import java.util.List;
/**
@ -20,16 +21,26 @@ public class Game implements IDrawableGame {
@Override
public int getWidth() {
return 0;
return BOARD_WIDTH;
}
@Override
public int getHeight() {
return 0;
return BOARD_HEIGHT;
}
@Override
public List<IDrawableObject> objectsToRender() {
return null;
List<IDrawableObject> list = new ArrayList<>();
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 12; j++) {
DrawableObject tileObj = new DrawableObject(i * 64, j * 64, GameTexture.TILE);
list.add(tileObj);
}
}
DrawableObject roboObj = new DrawableObject(128,128, GameTexture.ROBOT);
list.add(roboObj);
return list;
}
}

View File

@ -12,6 +12,6 @@ public class Main {
cfg.width = 768;
cfg.height = 769;
new LwjglApplication(new GameBoard(), cfg);
new LwjglApplication(new GameLauncher(), cfg);
}
}