game
Class Controller

java.lang.Object
  extended by game.Controller

public class Controller
extends java.lang.Object

As the primary controller of the game, this class provides hooks to control the game's components. It is separated from actual mouse events and such which are handled by Main.

Author:
Ron Cytron, with some changes by Jon Turner

Field Summary
static int numBricksHoriz
           
static int numBricksVert
           
 
Constructor Summary
Controller(nip.GraphicsPanel panel)
           
 
Method Summary
 void genBall()
          Generate a new Ball that starts at some random spot
 void setPaddle(lab4.Point p)
          Set the Paddle to the specified destination.
 void start()
          Starts the Clock ticking continuously.
 void stop()
          Halts the continuous ticking of the Clock.
 void tick(int numTicks)
          Called by a mouseClick from Main, this steps the game some number of ticks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numBricksHoriz

public static final int numBricksHoriz
See Also:
Constant Field Values

numBricksVert

public static final int numBricksVert
See Also:
Constant Field Values
Constructor Detail

Controller

public Controller(nip.GraphicsPanel panel)
Method Detail

genBall

public void genBall()
Generate a new Ball that starts at some random spot


start

public void start()
Starts the Clock ticking continuously.


stop

public void stop()
Halts the continuous ticking of the Clock.


setPaddle

public void setPaddle(lab4.Point p)
Set the Paddle to the specified destination.

Parameters:
p -

tick

public void tick(int numTicks)
Called by a mouseClick from Main, this steps the game some number of ticks.

Parameters:
numTicks - the number of ticks to step the game