Not sure I'm understanding exactly what you want, but inside the draw loop do something like this
ghost.x = ghost.x + 1; // moves ghost across the screen in a predictable path
if (ghost.x > 400){
ghost.x = 0; // start over when ghost gets to right edge of screen
}
OR
// to move the ghost pseudo randomly on the screen do the following inside the draw loop
ghost.x = randomNumber(0,400); // sets ghost x to random number somewhere on the screen
ghost.y = randomNumber(0,400); // sets ghost y to random number somewhere on the screen