client.brickblock.objects
Class SpeedUp

java.lang.Object
  extended by Sprite
      extended by client.brickblock.objects.Powerup
          extended by client.brickblock.objects.SpeedUp

public class SpeedUp
extends Powerup

Powerup implementation that increases the speed of whoever picks it up.

Author:
Martin Jarrett, Eivind Sorteberg

Field Summary
protected static java.lang.String imageAddress
           
 
Fields inherited from class client.brickblock.objects.Powerup
increment
 
Constructor Summary
SpeedUp(int xPos, int yPos, int increment)
          Constructor that creates a SpeedUp instance by calling the super constructor with the correct image and properties.
 
Method Summary
 void activate(BBPlayer player)
          Activates the power up by increasing the player's speed for the specified time.
 void deactivate(BBPlayer player)
          Returns the player's speed to what it would have been if he had not picked up the power up.
 java.lang.String getPowerUpName()
          Returns a three letter representation for this power up object.
 
Methods inherited from class client.brickblock.objects.Powerup
createPowerup, getValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageAddress

protected static java.lang.String imageAddress
Constructor Detail

SpeedUp

public SpeedUp(int xPos,
               int yPos,
               int increment)
        throws java.io.IOException
Constructor that creates a SpeedUp instance by calling the super constructor with the correct image and properties.

Parameters:
xPos - The x-coordinate of the object.
yPos - The y-coordinate of the object.
increment - The increment of the power up.
Throws:
java.io.IOException - If the image file is not found.
Method Detail

activate

public void activate(BBPlayer player)
Activates the power up by increasing the player's speed for the specified time.

Specified by:
activate in class Powerup
Parameters:
player - The player affected by the power up.
See Also:
BBPlayer.pickupPowerup(Powerup)

deactivate

public void deactivate(BBPlayer player)
Returns the player's speed to what it would have been if he had not picked up the power up.

Specified by:
deactivate in class Powerup
Parameters:
player - The player affected by the power up.

getPowerUpName

public java.lang.String getPowerUpName()
Returns a three letter representation for this power up object.

Specified by:
getPowerUpName in class Powerup
Returns:
The power up name.