Class PlayingView

java.lang.Object
view.gameStates.PlayingView
All Implemented Interfaces:
Observer

public class PlayingView extends Object implements Observer
The PlayingView class represents the view for the PlayingModel. It handles drawing and updating all game elements during gameplay.
  • Constructor Details

    • PlayingView

      public PlayingView(PlayingModel playingModel)
      Constructs a PlayingView with the specified models and controllers.
      Parameters:
      playingModel - the model for the playing state
  • Method Details

    • update

      public void update()
      Updates the state of all game elements.
    • draw

      public void draw(Graphics g)
      Draws all game elements on the screen.
      Parameters:
      g - the Graphics object to draw with
    • newLevelReset

      public void newLevelReset()
      Resets the state of all game elements for a new level.
    • newPlayReset

      public void newPlayReset()
      Resets the state of all game elements for a new play session.
    • initClasses

      public void initClasses()
      Initializes the classes for the player views and intro view.
    • update

      public void update(Observable o, Object arg)
      Updates the view based on changes in the observed model.
      Specified by:
      update in interface Observer
      Parameters:
      o - the observable object
      arg - an argument passed to the notifyObservers method
    • getGameCompletedOverlayView

      public GameCompletedOverlayView getGameCompletedOverlayView()
      Returns the player one view.
      Returns:
      the player one view
    • getGameOverOverlayView

      public GameOverOverlayView getGameOverOverlayView()
      Returns the player one view.
      Returns:
      the player one view