|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.physicsEngine.PhysicalItem
games.pinball.Box
public class Box
A box obstacle. Collision with the box will cause the box to spin, and the ball to bounce off, and score to be incremented.
Field Summary | |
---|---|
(package private) Pinball |
myPinball
|
Fields inherited from class vooga.physicsEngine.PhysicalItem |
---|
parameters |
Constructor Summary | |
---|---|
Box(double width,
double height,
Pinball pinball,
double Elasticity)
Constructs a new Box as a Rectangle with the given height and width The mass of the box is set to MAX_VALUE, and the Moment of inertia is set to 1000 in order to make the box stay in position, but spin around its centroid when it is collided with. |
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.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 |
Methods inherited from interface vooga.gameEngine.item.Renderable |
---|
getTexture, isVisible, setVisibility |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface vooga.gameEngine.item.Tangible |
---|
getPosition, getRotation, getShape, getSize, move, resize, rotate, setPosition, setRotation, setSize |
Field Detail |
---|
Pinball myPinball
Constructor Detail |
---|
public Box(double width, double height, Pinball pinball, double Elasticity)
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 itMethod Detail |
---|
public void collide(PhysicalItem otherObject)
Collidable
collide
in interface Collidable<PhysicalItem>
otherObject
- that has collided with this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |