Amph
YaBB Newbies
Offline
Posts: 1
activating different array after a certain time
Jun 9th , 2010, 5:25pm
hello everyone, i've been having trouble trying to have my program run with a different set of images... also, do you guys know a way to have the new images start a few seconds after the first set ends? there're these few lines i mark with asteriscs ***** (the whole 'else' part of the if) that i added... it activates when the program finishes running all the images in the array... that's as far as i got. i also tried preparing a different array with different images, but when i go to find it inside that 'else', something really bizarre happens... any help is very much appreciated, i need the code for an interactive installation piece that i'm working on, thanks! (oh and i also include my data folder if you wanna check it out, the program's pretty estetic) (?) http://rapidshare.com/files/397259667/data.rar.html PImage[] images = new PImage[9]; int cantImagenes = 9; int[][] capas; boolean[][] antes; int ancho = 800; int alto = 600; PImage pantalla; void setup(){ size(ancho,alto); capas = new int[ancho][alto]; antes = new boolean[ancho][alto]; for(int i=0;i<images.length;i++){ String s = (i+1)+".jpg"; images[i] = loadImage(s); } pantalla = createImage( ancho , alto , RGB ); pantalla.copy( images[0] , 0 , 0 , ancho , alto , 0 , 0 , ancho , alto ); background(0); } void draw(){ image( pantalla , 0 , 0 ); for( int i=0 ; i<ancho ; i++ ){ for( int j=0 ; j<alto ; j++ ){ if( dist(i,j,mouseX,mouseY) < 50 ){ //mouse is over if( !antes[i][j] ){ if( capas[i][j] < 8 ){ capas[i][j]++; int cualCapa = capas[i][j]; color c = images[ cualCapa ].get(i,j); pantalla.set( i , j , c ); } else{ rect(100,100,100,100);} ********** } antes[i][j] = true; } else{ // the mouse is not over antes[i][j] = false; } } } }