import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.*; public class PSprite extends Sprite { static int[] SPR_LEFT = new int[]{13, 14, 15, 16}; static int[] SPR_RIGHT = new int[]{5, 6, 7, 8}; static int[] SPR_DOWN = new int[]{9, 10, 11, 12}; static int[] SPR_UP = new int[]{ 0, 1, 2, 3}; public PSprite(Image image, int fw, int fh) { super(image, fw, fh); defineReferencePixel(10, 20); } public void moveLeft() { move(-2, 0); setFrameSequence(SPR_LEFT); } public void moveRight() { move(2, 0); setFrameSequence(SPR_RIGHT); } public void moveUp() { move(0, -2); setFrameSequence(SPR_UP); } public void moveDown() { move(0, 2); setFrameSequence(SPR_DOWN); } }