CSE115.BallWorld
Interface MovingBody

All Superinterfaces:
Colorable, EventListener, Graphic, Locatable, MouseListener, MouseMotionListener, Reactor, Rotatable, Shape, Sizeable
All Known Implementing Classes:
MovingBodyAdapter

public interface MovingBody
extends Shape

Normal users can ignore this interface. Methods needed for body that can be animated and moved.

Author:
Phil Ventura

Field Summary
 
Fields inherited from interface NGP.Colorable
DEFAULT_GRAY
 
Method Summary
 int getDx()
          Returns the horizontal velocity.
 int getDy()
          Returns the vertical velocity.
 void setVelocity(int dx, int 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

getDx

public int getDx()
Returns the horizontal velocity.

Returns:
the horizontal velocity.

getDy

public int getDy()
Returns the vertical velocity.

Returns:
the vertical velocity.

setVelocity

public void setVelocity(int dx,
                        int dy)
Sets the horizontal and vertical velocity.

Parameters:
dx - the new horizontal velocity.
dy - the new vertical velocity.

update

public void update()
Called frequently to update the body's position on the screen.