Package view.gameStates
Class PlayingView
java.lang.Object
view.gameStates.PlayingView
- All Implemented Interfaces:
Observer
The PlayingView class represents the view for the
PlayingModel.
It handles drawing and updating all game elements during gameplay.-
Constructor Summary
ConstructorsConstructorDescriptionPlayingView(PlayingModel playingModel) Constructs a PlayingView with the specified models and controllers. -
Method Summary
Modifier and TypeMethodDescriptionvoidDraws all game elements on the screen.Returns the player one view.Returns the player one view.voidInitializes the classes for the player views and intro view.voidResets the state of all game elements for a new level.voidResets the state of all game elements for a new play session.voidupdate()Updates the state of all game elements.voidupdate(Observable o, Object arg) Updates the view based on changes in the observed model.
-
Constructor Details
-
PlayingView
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
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
Updates the view based on changes in the observed model. -
getGameCompletedOverlayView
Returns the player one view.- Returns:
- the player one view
-
getGameOverOverlayView
Returns the player one view.- Returns:
- the player one view
-