|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MovingBody
Normal users can ignore this interface. Methods needed for body that can be animated and moved. Motion accomplished either through updates of velocity or by use of Vectors.
| Field Summary |
|---|
| Fields inherited from interface NGP.Colorable |
|---|
DEFAULT_GRAY |
| Method Summary | |
|---|---|
Integer |
getDx()
Returns the horizontal velocity. |
Integer |
getDy()
Returns the vertical velocity. |
Vector |
getVector()
This method is to be used to obtain a Vector from a MovingBody. |
void |
setVector(Vector newVector)
This method is to be used to pass a Vector to a MovingBody. |
void |
setVelocity(Integer dx,
Integer dy)
Sets the horizontal and vertical velocity. |
void |
update()
Called frequently to update the body's position on the screen. |
| Methods inherited from interface NGP.Graphic |
|---|
contains, getBounds, getCenterLocation, getDrawingPanel, hide, intersects, paint, setDrawingPanel, show |
| Methods inherited from interface NGP.Reactor |
|---|
react |
| Methods inherited from interface java.awt.event.MouseListener |
|---|
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased |
| Methods inherited from interface java.awt.event.MouseMotionListener |
|---|
mouseDragged, mouseMoved |
| Methods inherited from interface NGP.Rotatable |
|---|
getRotation, setRotation |
| Methods inherited from interface NGP.Locatable |
|---|
getLocation, setLocation |
| Methods inherited from interface NGP.Sizeable |
|---|
getDimension, setDimension |
| Methods inherited from interface NGP.Colorable |
|---|
getColor, setColor |
| Method Detail |
|---|
Integer getDx()
Integer getDy()
void setVelocity(Integer dx,
Integer dy)
dx - the new horizontal velocity.dy - the new vertical velocity.void setVector(Vector newVector)
newVector - The Vector to pass to the MovingBody.Vector getVector()
void update()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||