Class SidePanel

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class SidePanel extends JPanel implements ActionListener
This class displays the remaining time and treasures left for this game level, and the items in the player's inventory.
Author:
Diana
See Also:
  • Constructor Details

    • SidePanel

      public SidePanel(int time, int lvl)
      Initialises a new side panel upon the loading of a level.
      Parameters:
      time - The timer counting down the remaining time for the level.
      lvl - The current game level.
  • Method Details

    • setTime

      public void setTime(int timer)
      Updates the timer when the gameTimer in Base indicates.
      Parameters:
      timer - The current time of the game.
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener