class Player extends Sprite { AnimImage image; public Player() { image = new AnimImage(loadImage("ship1.gif"), 24, 24); x = 120; y = 200; lastX = new float[ROTATE_SIZE]; lastY = new float[ROTATE_SIZE]; for (int i=0; i0.5f) frame=2; image.draw(x-12,y-12,frame); } static final int ROTATE_SIZE = 50; float lastX[], lastY[]; int rotateLast = 0; void update() { float ax = input.x * 4; float ay = input.y * 3; dx += (ax-dx)/10; dy += (ay-dy)/10; x+=dx; y+=dy; lastX[rotateLast] = x; lastY[rotateLast] = y; rotateLast++; if (rotateLast>=ROTATE_SIZE) rotateLast=0; } }