Moving a picture

Well at this point i worked a bit further, The goal is that a fish should jump from a random start position to another (hard coded route) to another end point.

I know you guys don’t have the pictures and I am sorry for that if needed i can try to remake this model with squares.

the part that i am stuck on is the part were the movement of the fish is involved, I can create the random number from a mouseclick, but when i start to move the fish, first of all it is instant, second I get a whole trail of fish behind it, I guess that the background is not redrawn, but I don’t really know where is should place the background if i have to redraw it correctly.

If you have questions please ask, I am online.

//initilizing all images
PImage penguin;
PImage Fish1;
PImage Fish2;
PImage Fish3;
PImage Fish4;
PImage Wak1;
PImage Wak2;
PImage Wak3;
PImage Wak4;
PImage Hiddenfish;

//initilizing classes
Penguin P;
Fish F;

//initilizing X and Y
int x = 450;
int y = 450;

//setup
void setup() {
P = new Penguin();
F = new Fish();
size(1000, 1000);

//loading images
penguin = loadImage(“penguin.png”);
Fish1 = loadImage(“Fish.png”);
Fish2 = loadImage(“Fish.png”);
Fish3 = loadImage(“Fish.png”);
Fish4 = loadImage(“Fish.png”);
Wak1 = loadImage(“Wak.png”);
Wak2 = loadImage(“Wak.png”);
Wak3 = loadImage(“Wak.png”);
Wak4 = loadImage(“Wak.png”);
Hiddenfish = loadImage(“Hiddenfish.png”);
}

void draw() {
//placing images/background
background(203, 231, 243);
image(Hiddenfish, 0, 100);
image(Wak1, 650, 650);
image(Wak2, 100, 150);
image(Wak3, 650, 150);
image(Wak4, 100, 650);
image(penguin, x, y);

//Penguin movement
if (keyPressed) {
P.moveLeft();
P.moveUp();
P.moveDown();
P.moveRight();
}

}

void mousePressed() {
if (mousePressed) {
F.fishJump();
}
}

class Fish {
int Xfish = 0;
int Yfish = 0;
int jumpPosition;
int test;
void fishJump() {

if (mousePressed == true)
  mousePressed();

if (jumpPosition == 0) {
  
  for (int Xfish = 0; Xfish < 770; Xfish = Xfish+1) {
    image(Fish1, Xfish+220, Yfish+250);
  }
 
}

if (jumpPosition == 1)
{   
  for (int Xfish = 0; Xfish < 770; Xfish = Xfish+1) {
    image(Fish1, Xfish+220, Yfish+250);
  }
 
  
} 
if (jumpPosition == 2)
{  
  image(Fish3, Xfish+770, Yfish+750);
} 

if (jumpPosition == 3)
{   
  image(Fish4, Xfish+ 220, Yfish+750);
}

}

void mousePressed() {
jumpPosition = int(random(4));
println(jumpPosition);
}
}

draw() should start with background

for movement use lerp() (see reference please) but without the for-loop just use amt as a global variable and say amt += 0.011;