self
YaBB Newbies
Offline
Posts: 18
consecutive programs.
Jun 2nd , 2008, 10:35am
Hi, I have written a series of simple automated drawing programs similar to the script below which finish drawing at a finite point. I'd like to be able to 'connect' a series of these programs so that they run one after the other in a loop with a delay of say thirty seconds between each program (I hope this is clear!) My programming knowledge is minimal and I'm having trouble understanding how to make this work. if someone could give me some advice, I'd be most appreciative. thanks in advance. ------------------------------------------------------------ float a =0.0; float b =0.0; float c =50.0; float d =50.0; float e =1000; float f =0; float g = -50; float h = 50; float i =1000; float j =1000; float k =-50; float l= -50; float m= 0; float n= 1000; float o = 50; float p = -50; float s= 255; float x=10; float v=0; float w=10; float z=5; float y=10; float speed = 1; float direction = 8; float speed_s=1; float direction_s=10; float speed_v=1.0; float direction_v=10; float direction_w=20; float direction_z=10; void setup(){ size (1000,1000); background(0); } void draw(){ stroke (255); strokeWeight(1) ; fill(s); rect (a,b+z,c,d+w); rect (e,f+z,g,h+w); rect (i,j-z,k,l-w); rect (m,n-z,o,p-w); rect (a+z,b,c+w,d); rect (e+z,f,g+w,h); rect (i-z,j,k-w,l); rect (m-z,n,o-w,p); rect (a,b,c,d+z); rect (e,f,g,h+z); rect (i,j,k,l-z); rect (m,n,o,p-z); a=a+(speed*direction); b=b+(speed*direction); e=e-(speed*direction); f=f+(speed*direction); i=i-(speed*direction); j=j-(speed*direction); m=m+(speed*direction); n=n-(speed*direction); s=s-(speed_s*direction_s); v=v+(speed_v*direction_v); w=w+(speed*1*direction_w); z=z+(speed*3*direction_z); if (w<-0||w>1000){ direction_w=(direction_w*-1); } if (z<-0||z>500){ direction_z=(direction_z*-1); } if (v<0||v>250){ direction_v=(direction_v*-1); } if (s<0||s>250){ direction_s=(direction_s*-1); } if (a>500||a<0){ direction = (direction*-1); c=c-x; d=d-x; g=g+x; h=h-x; k=k+x; l=l+x; o=o-x; p=p+x; } if (c<0){ noLoop(); } }