games.pong.items
Class PongItem

java.lang.Object
  extended by vooga.gameEngine.game.GameRelatedObject
      extended by vooga.gameEngine.item.GameItem
          extended by vooga.physicsEngine.PhysicalItem
              extended by 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

Field Summary
 
Fields inherited from class vooga.physicsEngine.PhysicalItem
parameters
 
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.physicsEngine.PhysicalItem
applyAngularImpulse, applyImpulse, getPhysicsOn, setConstantForce, setPhysicsOn, setPosition, setPosition
 
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 vooga.gameEngine.game.GameRelatedObject
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PongItem

public PongItem(java.lang.String url,
                double width,
                double height,
                double centroidX,
                double centroidY)
Method Detail

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