this is my code...it is an animation...
int speedx = 20;
int speedy = 20;
int speeda = 8;
int speedb = 8;
int speedc = 10;
int x=640;
int y=640;
int ya=-130;
int a = 220;
int b = 5;
int c = 5;
int e = 300;
int f = 100;
boolean s= true;
void setup (){
size (640,479);
}
PImage []images = new PImage[9];
void draw (){
images [0] = loadImage ("sole.png");
image (images[0],91,522);
images[1]= loadImage("sfondo.png");
background(images[1]);
x-=speedx;
images [2]=loadImage ("dirigibile.png");
image (images[2],x,50);
if (x<=-300){
fill (#001600);
a = a + speeda;
ellipse (510, a, 3, 3);
}
if (a >=380){
a=380;
y-=speedy;
images[3]=loadImage ("nuvolaS190.png");
image (images[3],y,50);
ya+=speedy;
images[5]= loadImage ("nuvolaS170.png");
image (images[5],ya,40);
images[6]=loadImage ("nuvolaS180.png");
image (images[6],250,ya-90);
}
if (y <=400){
images[4]= loadImage("sfondopioggia.png");
background(images[4]);
speedy=0;
image(images[3],y,50);
image(images[5],ya,40);
image(images[6],250,ya-90);
images[7]=loadImage ("saetta100.png");
image (images[7],299,118);
e+=speeda;
f+=speedb;
images[8]=loadImage ("goccia10.png");
image (images[8],e,f);
}
}
The images[7] appears but after about two seconds should disappear and the rest remain the same ....
I apologize that the code is a bit messy