|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.AbstractToken
org.vizzini.example.pong.Ball
public class Ball
Provides a ball for Pong.
Field Summary |
---|
Fields inherited from class org.vizzini.game.AbstractToken |
---|
UNKNOWN_NAME |
Fields inherited from interface org.vizzini.game.IToken |
---|
AGENT_PROPERTY, NAME_PROPERTY, POSITION_PROPERTY, TEAM_PROPERTY |
Constructor Summary | |
---|---|
Ball()
Construct this object. |
Method Summary | |
---|---|
void |
configure(Properties properties,
int index)
Configure this token. |
Rectangle |
getBounds()
Return the bounds. |
int |
getRadius()
Return the radius. |
int |
getSpeed()
Return the speed. |
VectorPosition |
getVelocity()
Return the velocity. |
boolean |
isBounced()
Return true if this has bounced. |
protected boolean |
isBounced(Paddle paddle)
Return true if the ball should bounce off the given paddle. |
protected boolean |
isBounced(Rectangle obstacle)
Return true if the ball should bounce. |
void |
setAcceleration(double acceleration)
Set the scalar acceleration. |
void |
setRadius(int radius)
Set the radius. |
void |
setSpeed(int speed)
Set the speed. |
void |
setVelocity(VectorPosition velocity)
Set the velocity. |
void |
updatePosition(Rectangle top,
Rectangle bottom,
Paddle leftPaddle,
Paddle rightPaddle)
Update the position. |
Methods inherited from class org.vizzini.game.AbstractToken |
---|
addPropertyChangeListener, clone, copy, equals, getAgent, getIndex, getName, getPosition, getPropertyChangeManager, getTeam, getValue, hashCode, isFiringPositionChanges, removePropertyChangeListener, setAgent, setFiringPositionChanges, setIndex, setName, setPosition, setTeam, setValue, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Ball()
Method Detail |
---|
public void configure(Properties properties, int index)
configure
in interface IToken
configure
in class AbstractToken
properties
- Source of configuration information.index
- Index of this token's properties.public Rectangle getBounds()
public int getRadius()
public int getSpeed()
public VectorPosition getVelocity()
public boolean isBounced()
public void setAcceleration(double acceleration)
public void setRadius(int radius)
public void setSpeed(int speed)
public void setVelocity(VectorPosition velocity)
public void updatePosition(Rectangle top, Rectangle bottom, Paddle leftPaddle, Paddle rightPaddle)
protected boolean isBounced(Rectangle obstacle)
protected boolean isBounced(Paddle paddle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |