SmartFrog 3.10.000

org.smartfrog.examples.pong
Class Player

java.lang.Object
  extended by org.smartfrog.examples.pong.Player

public class Player
extends java.lang.Object

Defines the pong player component.


Constructor Summary
Player(Racket racket)
          Constructor a raclet object.
 
Method Summary
 void keyDown()
          Accelerates the racket in down direction.
 void keyDownReleased()
          Sets the acceleration in down direction.
 void keyLeft()
          Accelerates the racket in left direction.
 void keyLeftReleased()
          Sets the acceleration in left direction.
 void keyRight()
          Accelerates the racket in right direction.
 void keyRightReleased()
          Sets the acceleration in right direction.
 void keySpace()
          Sets the racket position when space key is pressed.
 void keyUp()
          Accelerates the racket in up direction.
 void keyUpReleased()
          Sets the acceleration in up direction.
 void setRacket(Racket racket)
          Specifies the racket position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player

public Player(Racket racket)
Constructor a raclet object.

Parameters:
racket - the racket object
Method Detail

setRacket

public void setRacket(Racket racket)
Specifies the racket position.

Parameters:
racket - racket object

keyDown

public void keyDown()
Accelerates the racket in down direction.


keyUp

public void keyUp()
Accelerates the racket in up direction.


keyLeft

public void keyLeft()
Accelerates the racket in left direction.


keyRight

public void keyRight()
Accelerates the racket in right direction.


keyDownReleased

public void keyDownReleased()
Sets the acceleration in down direction.


keyUpReleased

public void keyUpReleased()
Sets the acceleration in up direction.


keyLeftReleased

public void keyLeftReleased()
Sets the acceleration in left direction.


keyRightReleased

public void keyRightReleased()
Sets the acceleration in right direction.


keySpace

public void keySpace()
Sets the racket position when space key is pressed.


SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP