games.pong.items
Class PongItem
java.lang.Object
vooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.physicsEngine.PhysicalItem
games.pong.items.PongItem
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Renderable>, Renderable, Tangible
- Direct Known Subclasses:
- Ball, Paddle, Powerup
public abstract class PongItem
- extends PhysicalItem
A PongItem
will help to mediate creating an object from the Physics Engine
by providing functions which will be common to all objects used by Pong. These objects
will be created using an ImageTexture
.
- Author:
- Ben Getson
- See Also:
- Serialized Form
Constructor Summary |
PongItem(java.lang.String url,
double width,
double height,
double centroidX,
double centroidY)
|
Method Summary |
void |
changeImage(java.lang.String url)
Change the image used for the Texture of this object. |
void |
reduceSize(double percentage)
Reduce the dimensions of this Texture by a given percentage. |
void |
resetSize()
Reset this item to its regular size |
Methods inherited from class vooga.gameEngine.item.GameItem |
compareTo, getPosition, getRotation, getShape, getSize, getTexture, isVisible, move, resize, rotate, setPosition, setRotation, setSize, setVisibility |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PongItem
public PongItem(java.lang.String url,
double width,
double height,
double centroidX,
double centroidY)
changeImage
public void changeImage(java.lang.String url)
- Change the image used for the Texture of this object.
- Parameters:
url
- the URL of the image to replace with
reduceSize
public void reduceSize(double percentage)
- Reduce the dimensions of this Texture by a given percentage.
- Parameters:
percentage
- the amount to reduce each dimension by
resetSize
public void resetSize()
- Reset this item to its regular size