FaultInOurPong  1
model.Paddle Class Reference

Public Member Functions

 Paddle ()
 Constructor for a paddle. More...
 
void setPositionX (int x)
 sets the x-position of the paddle. More...
 
void setPositionY (int y)
 sets the y-position of the paddle. More...
 
int getPositionX ()
 returns the x position of the paddle. More...
 
int getPositionY ()
 returns the y position of the paddle. More...
 
int getWidth ()
 returns the width of the paddle. More...
 
int getHeight ()
 returns the height of the paddle. More...
 
int getInset ()
 returns the inset between the paddle and the screen. More...
 

Private Attributes

int positionX
 
int positionY
 
final int HEIGHT = 10
 
final int WIDTH = 80
 
final int INSET = 10
 
int speed
 

Constructor & Destructor Documentation

§ Paddle()

model.Paddle.Paddle ( )

Constructor for a paddle.

Constructor initialize the starting position of a paddle.

Member Function Documentation

§ getHeight()

int model.Paddle.getHeight ( )

returns the height of the paddle.

Returns
HEIGHT

§ getInset()

int model.Paddle.getInset ( )

returns the inset between the paddle and the screen.

Returns
INSET

§ getPositionX()

int model.Paddle.getPositionX ( )

returns the x position of the paddle.

Returns
positionX

§ getPositionY()

int model.Paddle.getPositionY ( )

returns the y position of the paddle.

Returns
positionY

§ getWidth()

int model.Paddle.getWidth ( )

returns the width of the paddle.

Returns
WIDTH

§ setPositionX()

void model.Paddle.setPositionX ( int  x)

sets the x-position of the paddle.

Parameters
xis the x position of the paddle.
Exceptions
ArithmeticExceptionx-position could not be set out of the game frame.

§ setPositionY()

void model.Paddle.setPositionY ( int  y)

sets the y-position of the paddle.

Parameters
yis the y position of the paddle.
Exceptions
ArithmeticExceptiony-position could not be set out of the game frame.

Member Data Documentation

§ HEIGHT

final int model.Paddle.HEIGHT = 10
private

The property of a paddle

  • the length of a paddle
  • the width of a paddle
  • the inset between a paddle and the screen frame

§ INSET

final int model.Paddle.INSET = 10
private

§ positionX

int model.Paddle.positionX
private

The position of a paddle

  • horizontal position x
  • vertical position y

§ positionY

int model.Paddle.positionY
private

§ speed

int model.Paddle.speed
private

§ WIDTH

final int model.Paddle.WIDTH = 80
private

The documentation for this class was generated from the following file: