example.payment.jbricks
Class Sprite

java.lang.Object
  extended by example.payment.jbricks.Sprite
Direct Known Subclasses:
Ball, Brick

public class Sprite
extends java.lang.Object

Provide some basic sprite functionality: getting and setting of coordinates and dimensions, as well as simple collision detection.


Field Summary
 int height
           
 int shadow
           
 int width
           
 int x
           
 int y
           
 
Constructor Summary
Sprite()
           
 
Method Summary
 int getCenterX()
           
 int getCenterY()
           
 boolean intersects(Sprite other)
           
 void moveBy(int x, int y)
           
 void moveTo(int x, int y)
           
 void paint(javax.microedition.lcdui.Graphics g)
           
 void paintShadow(javax.microedition.lcdui.Graphics g)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x

y

public int y

width

public int width

height

public int height

shadow

public int shadow
Constructor Detail

Sprite

public Sprite()
Method Detail

getCenterX

public int getCenterX()

getCenterY

public int getCenterY()

moveTo

public void moveTo(int x,
                   int y)

moveBy

public void moveBy(int x,
                   int y)

paint

public void paint(javax.microedition.lcdui.Graphics g)

paintShadow

public void paintShadow(javax.microedition.lcdui.Graphics g)

intersects

public boolean intersects(Sprite other)