Skip to content

Interfaces

ElanagaiArivuchelvan edited this page Sep 12, 2023 · 4 revisions

Team : 6

### BUILDINGS PLACEMENT :

The buildings are designed as obstacles positioned so that there is a moment of response time left for the player to control the game along with having the health of the in-game player on check

Building : 1

image

Building: 2

image

Walls are also a defensive obstacle that favours the user with accordance to the response time in game

Wall: 1

image

Functions and methods used to deploy these into the source code :

  1. createWallTower()
  2. createWeaponTower()
  3. spawnBaseTower(); spawnWeaponTower(); //spawnWallTower();
  4. createBaseTower()

Start menu Logo

image

The final picture after colour-coordinating the options and background: WhatsApp Image 2023-08-29 at 14 32 00

  • The color used in the background is : #0x809930FF.

** Drag and drop **

class used to implement this feature : GameAreaDisplay Functions used to implement this : Mouse input functions

WhatsApp Image 2023-09-12 at 13 41 50 WhatsApp Image 2023-09-12 at 13 42 12 WhatsApp Image 2023-09-12 at 13 42 39

Game over popup class used to implement this feature : PlayerStatsDisplay Function used to implement this : showGameOverPopup()

*private void showGameOverPopup() { // Create a Dialog pop-up for game over. Dialog gameOverDialog = new Dialog("Game Over", skin);

// Add a label with the game over message.
gameOverDialog.text("Your health reached 0. The game is over.");

// Add a button to restart the game or exit.
TextButton restartButton = new TextButton("Restart", skin);
TextButton exitButton = new TextButton("Exit", skin);

restartButton.addListener(new ClickListener() {
  @Override
  public void clicked(InputEvent event, float x, float y) {
    // Reset the player's health to 100.
    CombatStatsComponent combatStats = entity.getComponent(CombatStatsComponent.class);
    combatStats.setHealth(100);
    // Update the UI to reflect the new health value.
    updatePlayerHealthUI(combatStats.getHealth());
  }
});


exitButton.addListener(new ClickListener() {
  @Override
  public void clicked(InputEvent event, float x, float y) {
    // Handle exiting the game (e.g., return to the main menu or close the app).
    // You can use Gdx.app.exit() to close the app gracefully.
    Gdx.app.exit();
  }
});

**Skin selected : image

Clone this wiki locally