From 4439e71dc5f2a5a3f395cd02ad140e5c51c47ec8 Mon Sep 17 00:00:00 2001 From: GabrielMagnus Date: Mon, 3 Feb 2020 14:10:52 +0100 Subject: [PATCH] =?UTF-8?q?Closes=20#1=20Fullf=C3=B8rt=20game=20s=C3=A5=20?= =?UTF-8?q?den=20lager=20ett=20brett=20med=20tiles=20+=20en=20robot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main bruker nĂ¥ GameLauncher istedet for GameBoard --- src/main/java/inf112/skeleton/app/Game.java | 17 ++++++++++++++--- src/main/java/inf112/skeleton/app/Main.java | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/inf112/skeleton/app/Game.java b/src/main/java/inf112/skeleton/app/Game.java index 0851e52..6e8dd75 100644 --- a/src/main/java/inf112/skeleton/app/Game.java +++ b/src/main/java/inf112/skeleton/app/Game.java @@ -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 objectsToRender() { - return null; + List 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; } } diff --git a/src/main/java/inf112/skeleton/app/Main.java b/src/main/java/inf112/skeleton/app/Main.java index 36817ce..196b6b2 100644 --- a/src/main/java/inf112/skeleton/app/Main.java +++ b/src/main/java/inf112/skeleton/app/Main.java @@ -12,6 +12,6 @@ public class Main { cfg.width = 768; cfg.height = 769; - new LwjglApplication(new GameBoard(), cfg); + new LwjglApplication(new GameLauncher(), cfg); } } \ No newline at end of file