I'm loading numerous images in my sketch by loadImage(), and I want to make my sketch short and simple.
I think that I can use iteration 'for', but I have only used them in array[i]....
How can i shorten my sketch?
Here's an example of long one.
- PImage pat1;
- PImage pat2;
- PImage pat3;
- PImage pat4;
- PImage pat5;
- PImage pat6;
- PImage pat7;
- PImage pat8;
- PImage pat9;
- PImage pat10;
- PImage pat11;
- PImage pat12;
- PImage pat13;
- pat1 = loadImage("pattern01.png");
- pat2 = loadImage("pattern02.png");
- pat3 = loadImage("pattern03.png");
- pat4 = loadImage("pattern04.png");
- pat5 = loadImage("pattern05.png");
- pat6 = loadImage("pattern06.png");
- pat7 = loadImage("pattern07.png");
- pat8 = loadImage("pattern08.png");
- pat9 = loadImage("pattern09.png");
- pat10 = loadImage("pattern10.png");
- pat11 = loadImage("pattern11.png");
- pat12 = loadImage("pattern12.png");
- pat13 = loadImage("pattern13.png");
1