pl/mbogusz3/invaders/view/InvadersView.java
/**
	 * Draw player. Called from update().
	 * @param paneInsets insets of main content pane.
	 * @param paneSize size of main content pane.
	 */
Draw player. Called from update().
@param paneInsets insets of main content pane.
@param paneSize size of main content pane.
Draw player . Called from update () . @param paneInsets insets of main content pane . @param paneSize size of main content pane .
private void drawPlayer(Insets paneInsets, Dimension paneSize) {
		if(!this.model.isGameRunning()) {
			this.player.setVisible(false);
			return;
		} else {
			this.player.setVisible(true);
		}
		double playerPosition = this.model.getPlayer().getPosition();
		double playerWidth = this.model.getPlayer().getWidth();
		double playerPositionLeft = (playerPosition - 0.5 * playerWidth) * paneSize.width + paneInsets.left;
		double playerPositionTop = (1 - playerWidth) * paneSize.height + paneInsets.top;
		this.player.setText(Integer.toString(this.model.getPlayer().getHealth()));
		this.player.setBounds((int) (playerPositionLeft), (int) (playerPositionTop), (int) (playerWidth * paneSize.width), (int) (playerWidth * paneSize.height));
	}
private void drawPlayer ( Insets paneInsets , Dimension paneSize ) { if ( ! this . model . isGameRunning ( ) ) { this . player . setVisible ( false ) ; return ; } else { this . player . setVisible ( true ) ; } double playerPosition = this . model . getPlayer ( ) . getPosition ( ) ; double playerWidth = this . model . getPlayer ( ) . getWidth ( ) ; double playerPositionLeft = ( playerPosition - 0.5 * playerWidth ) * paneSize . width + paneInsets . left ; double playerPositionTop = ( 1 - playerWidth ) * paneSize . height + paneInsets . top ; this . player . setText ( Integer . toString ( this . model . getPlayer ( ) . getHealth ( ) ) ) ; this . player . setBounds ( ( int ) ( playerPositionLeft ) , ( int ) ( playerPositionTop ) , ( int ) ( playerWidth * paneSize . width ) , ( int ) ( playerWidth * paneSize . height ) ) ; }
Draw player.
Draw player .