|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectserver.brickblock.objects.Powerup
server.brickblock.objects.SpeedUp
public class SpeedUp
Powerup
implementation that increases
the speed of whoever picks it up.
Field Summary |
---|
Fields inherited from class server.brickblock.objects.Powerup |
---|
DEFAULT_DURATION_SECS, DEFAULT_SIZE |
Constructor Summary | |
---|---|
SpeedUp(int xPos,
int yPos,
int duration)
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.Object |
getAffectedAttribute(BBPlayer player)
Returns the player attribute that is affected by the power up object, i.e. speed. |
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 |
---|
public SpeedUp(int xPos, int yPos, int duration)
SpeedUp
instance
by calling the super constructor with the correct image
and properties.
xPos
- The x-coordinate of the object.yPos
- The y-coordinate of the object.duration
- How long the object lasts.Method Detail |
---|
public void activate(BBPlayer player)
activate
in class Powerup
player
- The player affected by the power up.public void deactivate(BBPlayer player)
deactivate
in class Powerup
player
- The player affected by the power up.public java.lang.Object getAffectedAttribute(BBPlayer player)
getAffectedAttribute
in class Powerup
player
- A BBPlayer
object.
public java.lang.String getName()
getName
in class Powerup
public int getIncrement()
getIncrement
in class Powerup
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |