why is my enemy image not showing?
//characters
PImage[] midas= new PImage[8];
PImage[] daughter= new PImage[3];
PImage[] enemy= new PImage[8];
boolean showMidas1= true;
//coordinates
float midasx= 1;
float midasy= 1;
float daughterx= width;
float daughtery= height;
float enemyprevx;
float enemyx= width-(width/4);
//i's
int i=1;
int i2= 1;
int i3= 1;
void setup() {
size(600, 600);
//load characters in
midas[1] = loadImage("1.png");
midas[2] = loadImage("2.png");
midas[3] = loadImage("3.png");
midas[4] = loadImage("4.png");
midas[5] = loadImage("5.png");
midas[6] = loadImage("6.png");
midas[7] = loadImage("7.png");
daughter[1] = loadImage("daughter.png");
daughter[2] = loadImage("daughter gold.png");
enemy[1]= loadImage("enemy1.png");
enemy[2]= loadImage("enemy2.png");
enemy[3]= loadImage("enemy3.png");
enemy[4]= loadImage("enemy4.png");
enemy[5]= loadImage("enemy5.png");
enemy[6]= loadImage("enemy6.png");
enemy[7]= loadImage("enemy7.png");
}
void draw() {
background(0, 0, 0);
tint(255, 255);
//show and move the characters
if ( (int) random(1, 3)== 1) {
enemyx=enemyx+10;
} else if ( (int) random(1, 3)== 2) {
enemyx=enemyx-10;
}
if (enemyprevx== enemyx) {
i3= 1;
image( enemy[i3], enemyx, height-(height/4), 55, 85 );
} else if (enemyprevx<enemyx) {
pushMatrix();
translate( enemyx + enemy[i3].width, height-(height/4));
scale( -1, 1 );
image( enemy[i3], enemyx, height-(height/4), 55, 85 );
popMatrix();
} else if (enemyprevx>enemyx) {
image(enemy[i3], enemyx, height-(height/4), 55, 85);
}
if (dist(midasx, midasy, daughterx, daughtery) < 45) {
i2=2;
}
image(daughter[i2], daughterx, daughtery, 40, 70);
if (showMidas1==true&& ! keyPressed) {
image(midas[1], midasx, midasy, 50, 80);
}
if (keyPressed) {
if (key == 'w') {
midasy=midasy-10;
image(midas[i], midasx, midasy, 50, 80);
showMidas1= false;
}
}
if (keyPressed) {
if (key == 's') {
midasy=midasy+10;
image(midas[i], midasx, midasy, 50, 80);
showMidas1= false;
}
}
if (keyPressed) {
if (key == 'a') {
midasx=midasx-10;
image(midas[i], midasx, midasy, 50, 80);
showMidas1= false;
}
}
if (keyPressed) {
if (key == 'd') {
midasx=midasx + 10;
image(midas[i], midasx, midasy, 50, 80);
showMidas1= false;
}
}
i++;
delay(100);
if (i==7) {
i=1;
}
}
void keyReleased() {
showMidas1 = true;
}