client.brickblock.objects
Class StrengthUp

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

public class StrengthUp
extends Powerup

Powerup implementation that increases the strength 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
StrengthUp(int xPos, int yPos, int increment)
          Constructor that creates a StrengthUp 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 strength for the specified time.
 void deactivate(BBPlayer player)
          Returns the player's strength 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

StrengthUp

public StrengthUp(int xPos,
                  int yPos,
                  int increment)
           throws java.io.IOException
Constructor that creates a StrengthUp 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 strength 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 strength 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.