PImage img1;
PImage img2;
PImage img3;
PImage img4;
PImage img5;
PImage img6;
PImage img7;
PImage img8;
PImage img9;
int frame;
void setup() {
size(400, 400);
background(0, 0, 0);
frameRate(3);
frame = 1;
img1 = loadImage("r1.jpg");
img2 = loadImage("r2.jpg");
img3 = loadImage("r3.jpg");
img4 = loadImage("r4.jpg");
img5 = loadImage("r5.jpg");
img6 = loadImage("r6.jpg");
img7 = loadImage("r7.jpg");
img8 = loadImage("r8.jpg");
img9 = loadImage("r9.jpg");
}
void draw() {
if (frame > 9) {
frame = 1;
}
if (frame == 1) {
image (img1, 0, 0, 400, 400);
}
if (frame == 2) {
image (img2, 0, 0, 400, 400);
}
if (frame == 3) {
image (img3, 0, 0, 400, 400);
}
if (frame == 4) {
image (img4, 0, 0, 400, 400);
}
if (frame == 5) {
image (img5, 0, 0, 400, 400);
}
if (frame == 6) {
image (img6, 0, 0, 400, 400);
}
if (frame == 7) {
image (img7, 0, 0,400, 400);
}
if (frame == 8) {
image (img8, 0, 0,400, 400);
}
if (frame == 9) {
image (img9, 0, 0, 400, 400);
}
frame = frame + 1;
}