looping slideshow indefinitely
in
Programming Questions
•
11 months ago
hey all,
I have been working on this slideshow for a while. I've solved all of my previous errors, if anyone has been keeping track. Now I have my entire slideshow, but I can't figure out how to loop it continuously. To be more explicit, once my sketch has reached the 3060th image (or 3060th frame, as I have it coded right now), how do I make it start from the beginning? I only want my slideshow to stop when I press escape (once it has been exported as an application).
Here's my code, and thanks for the help!
- int n=0;
- int x=0;
- int y=1;
- int z=0;
- int w=1;
- int num2;
- int num1;
- int num3;
- char letter= 'A';
- float randLetter;
- int roundLetter;
- void setup() {
- size(1440, 900);
- frameRate(120);
- }
- void draw () {
- background(0);
- if (frameCount <= 1440){
- image(loadImage((y)+"_"+(letter)+""+(x)+ "_" + (n) + ".jpg"),0,0,width,height);
- if ( n < 8 ){
- n++;
- if (n%8<=0){
- n=0;
- x++;
- if (x%6<=0){
- letter++;
- x=0;
- n=0;
- if (frameCountH0<=0){
- y++;
- letter='A';
- x=0;
- n=0;
- }}}}
- println((y)+"_"+(letter)+""+(x)+ "_" + (n) + ".jpg");
- }
- if (frameCount > 1440 && frameCount <= 1619){
- image(loadImage((z+1)+"_"+(letter)+""+(num2)+ "_4.jpg"),0,0,width,height);
- x=round(random(0,5));
- byte b= byte(x);
- num2=b;
- randLetter=(random(65,74));
- byte c= byte(randLetter);
- letter=char(c);
- if (frameCount`<=0){
- if (z<3){
- z=z+1;
- }
- }
- println((z+1)+"_"+(letter)+""+(num2)+ "_4.jpg");
- }
- if (frameCount > 1619 && frameCount <= 3060){
- image(loadImage((w)+"_"+(letter)+""+(num2)+ "_" + (num1) + ".jpg"),0,0,width,height);
- w=round(random(1,3));
- byte d= byte(w);
- num3=d;
- n=round(random(0,7));
- byte a= byte(n);
- num1=a;
- x=round(random(0,5));
- byte b= byte(x);
- num2=b;
- randLetter=(random(65,74));
- byte c= byte(randLetter);
- letter=char(c);
- println((w)+"_"+(letter)+""+(num2)+ "_" + (num1) + ".jpg"+ " framecount: " + frameCount);
- if (frameCount060<=0){
- frameCount=0;
- }
- }
- }
1