example.payment.jbricks
Class Ball
java.lang.Object
example.payment.jbricks.Sprite
example.payment.jbricks.Ball
public class Ball
- extends Sprite
This class implements the ball, with its radius,
and x and y step size. The ball knows how to draw
itself, and every once in a while it will do a
subtle, pseudo-random path modification to prevent
closed ball paths.
Field Summary |
static int |
RADIUS
|
Constructor Summary |
Ball(int x,
int y,
int dx,
int dy)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RADIUS
public static final int RADIUS
Ball
public Ball(int x,
int y,
int dx,
int dy)
setSteps
public void setSteps(int dx,
int dy)
getXStep
public int getXStep()
getYStep
public int getYStep()
move
public void move()
bounceHorizontal
public void bounceHorizontal()
bounceVertical
public void bounceVertical()
bounce
public void bounce(Sprite other)
paintShadow
public void paintShadow(javax.microedition.lcdui.Graphics g)
- Overrides:
paintShadow
in class Sprite
paint
public void paint(javax.microedition.lcdui.Graphics g)
- Overrides:
paint
in class Sprite