server.brickblock.objects
Class SizeUp

java.lang.Object
  extended by server.brickblock.objects.Powerup
      extended by server.brickblock.objects.SizeUp

public class SizeUp
extends Powerup

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

Author:
Martin Jarrett, Eivind Sorteberg

Field Summary
 
Fields inherited from class server.brickblock.objects.Powerup
DEFAULT_DURATION_SECS, DEFAULT_SIZE
 
Constructor Summary
SizeUp(int xPos, int yPos, int duration)
          Constructor that creates a SizeUp 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 size for the specified time.
 void deactivate(BBPlayer player)
          Returns the player's size to what it would have been if he had not picked up the power up.
 java.lang.Object getAffectedAttribute(BBPlayer player)
          Returns the player attribute that is affected by the power up object, i.e.size.
 int getIncrement()
          Returns the power up's increment value, i.e. how much the player's affected attribute is incremented when picking up the power up.
 java.lang.String getName()
          Returns a three letter String representation of the power up object.
 
Methods inherited from class server.brickblock.objects.Powerup
getAttributes, getDuration, getPosition, getTimeout, setDuration, setPosition, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeUp

public SizeUp(int xPos,
              int yPos,
              int duration)
Constructor that creates a SizeUp 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.
duration - How long the object lasts.
Method Detail

activate

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

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

deactivate

public void deactivate(BBPlayer player)
Returns the player's size 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.

getAffectedAttribute

public java.lang.Object getAffectedAttribute(BBPlayer player)
Returns the player attribute that is affected by the power up object, i.e.size.

Specified by:
getAffectedAttribute in class Powerup
Parameters:
player - A BBPlayer object.
Returns:
The size attribute.

getName

public java.lang.String getName()
Returns a three letter String representation of the power up object.

Specified by:
getName in class Powerup
Returns:
The name of the power up object

getIncrement

public int getIncrement()
Returns the power up's increment value, i.e. how much the player's affected attribute is incremented when picking up the power up.

Specified by:
getIncrement in class Powerup
Returns:
The power up's increment value.