games.pinball
Class ImageObstacle
java.lang.Object
vooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.physicsEngine.PhysicalItem
games.pinball.ImageObstacle
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Renderable>, Collidable<PhysicalItem>, Renderable, Tangible
public class ImageObstacle
- extends PhysicalItem
- implements Collidable<PhysicalItem>
Creates an obstacle from an image
- Author:
- Sami Boghos, Used some resources from the Space Invaders game
- See Also:
- Serialized Form
Constructor Summary |
ImageObstacle(double width,
double height,
Pinball pinball,
java.lang.String string,
double Elasticity)
Constructs a new Obstacle from an Image. |
Method Summary |
void |
collide(PhysicalItem otherObject)
This method is called whenever an object of the specified type has
collided with this object. |
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 |
Methods inherited from interface java.lang.Comparable |
compareTo |
RESOURCES
public static final java.util.ResourceBundle RESOURCES
myPinball
Pinball myPinball
ImageObstacle
public ImageObstacle(double width,
double height,
Pinball pinball,
java.lang.String string,
double Elasticity)
- Constructs a new Obstacle from an Image. The mass is set to MAX_VALUE and
MomentofInertia is set to 1000 in order to cause the ship to spin while
staying in place when collided with
- Parameters:
width
- the width of the Barrier to createheight
- the height of the Barrier to createpinball
- Pinball objectElasticity
- the Elasticity of the obstacle, can be set to greater
than 1 to give the ball a boost when it bounces off of it
collide
public void collide(PhysicalItem otherObject)
- Description copied from interface:
Collidable
- This method is called whenever an object of the specified type has
collided with this object.
- Specified by:
collide
in interface Collidable<PhysicalItem>
- Parameters:
otherObject
- that has collided with this object