Class CombatExitDisplay

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class CombatExitDisplay extends UIComponent
Displays two buttons during combat to exit the Main Game screen and return to the Main Menu screen. One button allows for an "instant kill" win, and the other triggers a loss, simulating the player losing the combat.
  • Constructor Details

    • CombatExitDisplay

      public CombatExitDisplay(Entity enemy)
  • Method Details

    • create

      public void create()
      Initializes the UI component by calling the parent class' create method and adding actors (buttons).
      Overrides:
      create in class UIComponent
    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      The drawing is handled by the Stage, so no additional drawing logic is needed here.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - the SpriteBatch used for drawing
    • getZIndex

      public float getZIndex()
      Gets the Z-index, which determines the rendering order of this UI component. A higher Z-index indicates that this component will be rendered on top of others.
      Specified by:
      getZIndex in interface Renderable
      Overrides:
      getZIndex in class UIComponent
      Returns:
      the Z-index of this UI component
    • dispose

      public void dispose()
      Cleans up the UI component by clearing the table and disposing of resources.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent