diff --git a/Server/src/Server.java b/Server/src/Server.java index 0a9b874effb3ffc84d82fff3ad3b5817fe238b82..26d6ee239d5bff5cb13d31da4ff1c58efd2ece19 100644 --- a/Server/src/Server.java +++ b/Server/src/Server.java @@ -9,7 +9,6 @@ public class Server { * Start the server */ public static void main(String[] args) { - } /** diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/Main.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/Main.java index 4d28ea55b176f948a5827374b21efca6de078eac..23bf73a55615885bf90d6da31fbaa746d2793f5b 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/Main.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/Main.java @@ -3,31 +3,53 @@ package com.galaxytrucker.galaxytruckerreloaded; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class Main extends Game { - SpriteBatch batch; - Texture img; - - @Override - public void create () { - batch = new SpriteBatch(); - img = new Texture("badlogic.jpg"); - } - - @Override - public void render () { - Gdx.gl.glClearColor(1, 0, 0, 1); - Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); - batch.begin(); - batch.draw(img, 0, 0); - batch.end(); - } - - @Override - public void dispose () { - batch.dispose(); - img.dispose(); - } + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + @Override + public void create() { + this.batch = new SpriteBatch(); + this.camera = new OrthographicCamera(); + } + + @Override + public void render() { + Gdx.gl.glClearColor(1, 0, 0, 1); + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); + } + + @Override + public void dispose() { + + } + + /** + * Get the sprite batch + * + * @return the sprite batch + */ + public SpriteBatch getBatch() { + return this.batch; + } + + /** + * Get the orthographic camera + * + * @return the orthographic camera + */ + public OrthographicCamera getCamera() { + return this.camera; + } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java index c55d649ddb76bc5adb4f9c68c48a4f5326f70f46..0c639c2a51c3a20d832f3cf2db01f9e6b5a48942 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/GamePlay.java @@ -7,6 +7,8 @@ import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.galaxytrucker.galaxytruckerreloaded.Main; +import com.galaxytrucker.galaxytruckerreloaded.View.UI.Map.MapUI; +import com.sun.tools.jdi.Packet; /** * Main game screen @@ -28,11 +30,6 @@ public class GamePlay implements Screen { */ private Texture background; - /** - * Main class for spriteBatch - */ - private Main mainClass; - /** * Looping music */ @@ -43,6 +40,16 @@ public class GamePlay implements Screen { */ private Sound clickSound; + /** + * MultiPlayer active + */ + private boolean multiPlayer; + + /** + * Current map + */ + private MapUI gameMap; + @Override public void show() { @@ -89,7 +96,22 @@ public class GamePlay implements Screen { /** * Constructor + * + * @param main - main class */ public GamePlay(Main main) { } + + /** + * Send data to server + */ + private void sendData(Packet data) { + } + + /** + * Receive data from server + */ + private Packet receiveData() { + return null; + } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java index 391ed73bcf8f2c428f0b90f846e0757e62097a80..03930b4c6b903143f69b58bd8e62dc7a6b615910 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/LoginScreen.java @@ -41,9 +41,9 @@ public class LoginScreen implements Screen { private ImageButton loginButton; /** - * Main class for spriteBatch + * Login button texture */ - private Main mainClass; + private Texture loginButtonTexture; /** * Looping music track @@ -90,6 +90,11 @@ public class LoginScreen implements Screen { } - /** Constructor */ - public LoginScreen(Main main){} + /** + * Constructor + * + * @param main - main class + */ + public LoginScreen(Main main) { + } } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java index d03aad0816e4a9e526d558659c18ecd1cc5f5615..47de18aae6d29f120ab25614d9f7befcdc1eeb47 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/MainMenu.java @@ -32,22 +32,22 @@ public class MainMenu implements Screen { /** * SinglePlayer button */ - private ImageButton singleplayerButton; + private ImageButton singlePlayerButton; /** * SinglePlayer button texture */ - private Texture singleplayerButtonTexture; + private Texture singlePlayerButtonTexture; /** * MultiPlayer button */ - private ImageButton multiplayerButton; + private ImageButton multiPlayerButton; /** * MultiPlayer button texture */ - private Texture multiplayerButtonTexture; + private Texture multiPlayerButtonTexture; /** * Options button @@ -69,11 +69,6 @@ public class MainMenu implements Screen { */ private ImageButton quitButtonTexture; - /** - * Main class for accessing SpriteBatch - */ - private Main mainClass; - /** * Looping music track */ @@ -119,6 +114,7 @@ public class MainMenu implements Screen { } - /** Constructor */ + /** Constructor + * @param main - main class */ public MainMenu(Main main){} } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/PauseMenu.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/PauseMenu.java new file mode 100644 index 0000000000000000000000000000000000000000..5290086244da856b09424b5b1ef4a0b224c4160f --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/PauseMenu.java @@ -0,0 +1,68 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.Screen; + +import com.badlogic.gdx.Screen; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +/** + * Pause menu screen + */ +public class PauseMenu implements Screen { + + /** + * Sptire batch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * Game paused texture + */ + private Texture pausedTexture; + + @Override + public void show() { + + } + + @Override + public void render(float delta) { + + } + + @Override + public void resize(int width, int height) { + + } + + @Override + public void pause() { + + } + + @Override + public void resume() { + + } + + @Override + public void hide() { + + } + + @Override + public void dispose() { + + } + + /** Constructor + * @param main - main class */ + public PauseMenu(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java index ab83bb5bfdd813e878b90a7e713084ebac69232d..6df16eabe36d950d938520f7d535394f02516158 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/Screen/ShipSelector.java @@ -73,6 +73,7 @@ public class ShipSelector implements Screen { } - /** Constructor */ + /** Constructor + * @param main - main class */ public ShipSelector(Main main){} } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java new file mode 100644 index 0000000000000000000000000000000000000000..4543eb4ea1220f80826e23802307ebe3e26dfb24 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Events/GameOver.java @@ -0,0 +1,55 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Events; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class GameOver { + + /** + * Game over texture + */ + private Texture gameOverTexture; + + /** + * Main menu button + */ + private ImageButton mainMenuButton; + + /** + * Main menu button texture + */ + private Texture mainMenuButtonTexture; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the ui + */ + public void showGameOverUI() { + } + + /** + * hide the ui + */ + public void hideGameOverUI() { + } + + /** + * Dispose of the ui + */ + public void disposeGameoverUI() { + } + + /** + * Constructor + * + * @param main - main class + */ + public GameOver(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlot.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlot.java deleted file mode 100644 index 64a8a29812af1f82c0eb84c20ab2f568239b3ad3..0000000000000000000000000000000000000000 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlot.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; - -import com.galaxytrucker.galaxytruckerreloaded.Main; - -public class InventorySlot { - - /** Constructor */ - public InventorySlot(Main main){} -} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java new file mode 100644 index 0000000000000000000000000000000000000000..1b56cdce201f8fe644c79d82b4f03a4a45ccbf7d --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventorySlotUI.java @@ -0,0 +1,66 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class InventorySlotUI { + + /** + * Sprite batch for rendering + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * Inventory slot position x + */ + private float posX; + + /** + * Inventory slot position y + */ + private float posY; + + /** + * Inventory slot background + */ + private Texture inventorySlotTexture; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the ui + */ + public void showInventorySlotUI() { + } + + /** + * Hide inventory slot ui + */ + public void hideInventorySlotUI() { + } + + /** + * Dispose inventory slot ui + */ + public void disposeInventorySlotUI() { + } + + /** + * Constructor + * + * @param main - main class + */ + public InventorySlotUI(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java new file mode 100644 index 0000000000000000000000000000000000000000..75f7dbc8d9f84908c2e9dc87a18841fc60c088ec --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Inventory/InventoryUI.java @@ -0,0 +1,73 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Inventory; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class InventoryUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * Inventory background texture + */ + private Texture inventoryBackground; + + /** + * Inventory slots + */ + private List<InventorySlotUI> slots; + + /** + * Close inventory button + */ + private ImageButton closeInventoryButton; + + /** + * Close inventory button texture + */ + private Texture closeInventoryButtonTexture; + + /** + * setup called after initialisation + */ + private void setup() { + } + + /** + * show the inventory + */ + public void showInventoryUI() { + } + + /** + * hide the inventory + */ + public void hideInventoryUI() { + } + + /** + * Dispose of inventory + */ + public void disposeInventoryUI() { + } + + /** + * Constructor + * + * @param main - main class + */ + public InventoryUI(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/InventoryUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/InventoryUI.java deleted file mode 100644 index 2bde8297297a9855447d91028be65433f16bacc1..0000000000000000000000000000000000000000 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/InventoryUI.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.galaxytrucker.galaxytruckerreloaded.View.UI; - -import com.galaxytrucker.galaxytruckerreloaded.Main; - -public class InventoryUI { - - /** Constructor */ - public InventoryUI(Main main){} -} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java new file mode 100644 index 0000000000000000000000000000000000000000..3670346c158661aa02447567bbc08c0c6e7f2521 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Map/MapUI.java @@ -0,0 +1,50 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.Map; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class MapUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** + * Map texture + */ + private Texture mapTexture; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * show the ui + */ + public void showMapUI() { + } + + /** + * hide the ui + */ + public void hideMapUI() { + } + + /** + * Dispose of ui + */ + public void disposeMapUI() { + } + + /** + * Constructor + * + * @param main - main class + */ + public MapUI(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java index 8c082735e888b5784f75f953ff1af1fe324f9945..95cb3ab9c53072884a33cf235fffea8d75a09a4a 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/Options/OptionsUI.java @@ -21,6 +21,11 @@ public class OptionsUI { */ private OrthographicCamera camera; + /** + * Options ui background + */ + private Texture optionsBackgroundTexture; + /** * Continue button */ @@ -51,11 +56,6 @@ public class OptionsUI { */ private Texture quitButtonTexture; - /** - * Main class for sprite batch - */ - private Main mainClass; - /** * Setup called after initialisation */ @@ -65,17 +65,25 @@ public class OptionsUI { /** * Open the options menu */ - public void openOptions() { + public void showOptionsUI() { } /** * Close the options menu */ - public void closeOptions() { + public void hideOptionsUI() { + } + + /** + * Dispose of options ui + */ + public void disposeOptionsUI() { } /** * Constructor + * + * @param main - main class */ public OptionsUI(Main main) { setup(); diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java index ed48f782420aacc31dec3bdd06d9dbd6cd883a5c..82870ec2b467c6b4757b1e6985b22d12580219b7 100644 --- a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/HullUI.java @@ -1,5 +1,6 @@ package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; +import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.ui.List; @@ -16,17 +17,48 @@ public class HullUI { private SpriteBatch batch; /** - * Textures + * Orthographic camera + */ + private OrthographicCamera camera; + + /** + * HullUI background texture + */ + private Texture HullBackgroundTexture; + + /** + * Change amount of hull integrity based on hp */ private List<Texture> hullTextures; /** - * Main class for sprite batch + * setup called after initialisation + */ + private void setup() { + } + + /** + * show ui */ - private Main mainClass; + public void showHullUI() { + } + + /** + * hide ui + */ + public void hideHullUI() { + } + + /** + * dispose + */ + public void disposeHullUI() { + } /** * Constructor + * + * @param main - main class */ public HullUI(Main main) { } diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java new file mode 100644 index 0000000000000000000000000000000000000000..42895a13e23bc7052c2557e7edbf26e7a50d03bf --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ScrapUI.java @@ -0,0 +1,56 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class ScrapUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** + * Orthographic Camera + */ + private OrthographicCamera camera; + + /** + * Scrap UI background + */ + private Texture scrapBackground; + + /** + * setup called after initialisation + */ + private void setup() { + } + + /** + * show the ui + */ + public void showScrapUI() { + } + + /** + * hide the ui + */ + public void hideScrapUI() { + } + + /** + * Dispose of ui + */ + public void disposeScrapUI() { + } + + /** + * Constructor + * + * @param main - main class used for sprite batch and camera + */ + public ScrapUI(Main main) { + } +} diff --git a/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java new file mode 100644 index 0000000000000000000000000000000000000000..6f7573daa8c8b484eabf130235b2823df83ceec5 --- /dev/null +++ b/core/src/com/galaxytrucker/galaxytruckerreloaded/View/UI/ShipInformation/ShieldUI.java @@ -0,0 +1,60 @@ +package com.galaxytrucker.galaxytruckerreloaded.View.UI.ShipInformation; + +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.scenes.scene2d.ui.List; +import com.galaxytrucker.galaxytruckerreloaded.Main; + +public class ShieldUI { + + /** + * Sprite batch + */ + private SpriteBatch batch; + + /** Orthographic camera */ + private OrthographicCamera camera; + + /** + * Shield screen background texture + */ + private Texture background; + + /** + * Shield textures + */ + private List<Texture> shieldTextures; + + /** + * Setup called after initialisation + */ + private void setup() { + } + + /** + * Show shield ui + */ + public void showShieldUI() { + } + + /** + * hide the shield ui + */ + public void hideShieldUI() { + } + + /** + * Dispose of shield ui + */ + public void disposeShieldUI() { + } + + /** + * Constructor + * + * @param main - the main class + */ + public ShieldUI(Main main) { + } +}