// Add into public class declaration final int UP=0; final int DOWN=1; final int LEFT=2; final int RIGHT=3; int[] ghostPath; int numStepsInPath; final int MAX_PATH_LENGTH=20; Image error; // ADDED into init() ghostPath = new int[MAX_PATH_LENGTH]; numStepsInPath = 2; ghostPath[0] = RIGHT; ghostPath[1] = UP; // ADDED after call to DrawPacMan() in PlayGame(); DrawPath(); // ADDED at end of GetImages(); error=getImage(getDocumentBase(),"pacpix/error.gif"); thetracker.addImage(error,0); public void DrawPath() { int i; int currX = (ghostx[0]/blocksize)*blocksize, currY = (ghosty[0]/blocksize)*blocksize; String s; for (i=0; i= nrofblocks*blocksize || currY < 0 | currY >= nrofblocks*blocksize) { goff.drawImage(error,scrsize/2+32,scrsize,this); } else { s = ""+i; goff.drawString(s,currX+blocksize/2 -7,currY+blocksize/2+7); } } } // this code determines where the characters can move // free(x, y) = level1data[x+y*nrofblocks]&16;