java.lang.Object
project.pong.model.Options
The Options class represents the game settings for Pong.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the speed increase factor for the ball.doubleGets the initial speed of the ball.Gets the name of player 1.Gets the name of player 2.intGets the height of the rackets.intGets the width of the rackets.intGets the score required to win the game.voidsetPlayer1Name(String player1Name) Sets the name of player 1.voidsetPlayer2Name(String player2Name) Sets the name of player 2.
-
Constructor Details
-
Options
public Options(String player1Name, String player2Name, int scoreToWin, int racketWidth, int racketHeight, double ballSpeed, Double ballIncreaseSpeed) Constructs an Options object with the specified parameters.- Parameters:
player1Name- The name of player 1.player2Name- The name of player 2.scoreToWin- The score required to win the game.racketWidth- The width of the rackets.racketHeight- The height of the rackets.ballSpeed- The initial speed of the ball.ballIncreaseSpeed- The speed increase factor for the ball.
-
-
Method Details
-
getPlayer1Name
Gets the name of player 1.- Returns:
- The name of player 1.
-
setPlayer1Name
Sets the name of player 1.- Parameters:
player1Name- The name of player 1 to set.
-
getPlayer2Name
Gets the name of player 2.- Returns:
- The name of player 2.
-
setPlayer2Name
Sets the name of player 2.- Parameters:
player2Name- The name of player 2 to set.
-
getScoreToWin
public int getScoreToWin()Gets the score required to win the game.- Returns:
- The score required to win the game.
-
getRacketWidth
public int getRacketWidth()Gets the width of the rackets.- Returns:
- The width of the rackets.
-
getRacketHeight
public int getRacketHeight()Gets the height of the rackets.- Returns:
- The height of the rackets.
-
getBallSpeed
public double getBallSpeed()Gets the initial speed of the ball.- Returns:
- The initial speed of the ball.
-
getBallIncreaseSpeed
Gets the speed increase factor for the ball.- Returns:
- The speed increase factor for the ball.
-