Class GameOverlayView

java.lang.Object
view.overlays.gameOverlays.GameOverlayView
Direct Known Subclasses:
GameCompletedOverlayView, GameOverOverlayView, GamePausedOverlayView

public abstract class GameOverlayView extends Object
Abstract class representing the base structure of a game overlay view. Handles the drawing of the overlay, including the title and control instructions.
  • Field Details

    • playingModel

      protected final PlayingModel playingModel
    • nesFont

      protected final Font nesFont
    • retroFont

      protected final Font retroFont
    • firstUpdate

      protected boolean firstUpdate
  • Constructor Details

    • GameOverlayView

      public GameOverlayView(PlayingModel playingModel)
      Constructs a GameOverlayView with the specified PlayingModel. Initializes the fonts used in the overlay.
      Parameters:
      playingModel - the model of the playing state
  • Method Details

    • draw

      public void draw(Graphics g)
      Draws the overlay on the screen. Sets the background color, audio, title, and control instructions.
      Parameters:
      g - the Graphics object to draw with
    • reset

      public void reset()
      Resets the overlay state for a new update. Sets the firstUpdate flag to true.
    • drawTitle

      protected abstract void drawTitle(Graphics g)
      Draws the title of the overlay.
      Parameters:
      g - the Graphics object to draw with
    • drawControls

      protected abstract void drawControls(Graphics g)
      Draws the control instructions of the overlay.
      Parameters:
      g - the Graphics object to draw with
    • setAudio

      protected abstract void setAudio()
      Sets the audio for the overlay.