Class PongScore

java.lang.Object
  |
  +--PongScore

public class PongScore
extends java.lang.Object

This class desribes objects that are used to track the player's scores in a game of Pong. Each PongScore object will keep the score for a single player.


Constructor Summary
PongScore()
          Construct a new PongScore object with an initial score of zero points.
 
Method Summary
 int getScore()
          Return the current score of this PongScore object.
 void scorePoints(int points)
          Increase the current score of this PongScore object by points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PongScore

public PongScore()
Construct a new PongScore object with an initial score of zero points.

Method Detail

getScore

public int getScore()
Return the current score of this PongScore object.

Returns:
the score.

scorePoints

public void scorePoints(int points)
Increase the current score of this PongScore object by points.

Parameters:
points - the number of points to add to the score.


Free Web Hosting