i'm trying to change the arraylist size so that different levels will give a different number of objects but it isn't working, in the arraylist loop i call NumOfCookies and i did assign NumOfCookies to be 8, but when i assign it a different number in the picklevel(), it still generates 8 cookies, is there something i'm missing?
its suppose to generate the # of cookies inside keypressed for that level, ie. 10 for medim, 30 for hard...etc
int gamecontrol = 1;
int NumOfCookies = 8;
ArrayList cookies;
Gui gameBackground;
ArrayList triList = new ArrayList();
ArrayList squareList = new ArrayList();
ArrayList circleList = new ArrayList();
void setup() {
background(255);
smooth();
size(465, 641);
//cookie arraylist
cookies = new ArrayList();
for(int i = 0; i < NumOfCookies; i++) {
println("make cookie");
cookies.add( new cookie(random(90,440), 18) );
}
press = true;
MonstarC = new ArrayList();
monstar = new Monstar(200,550);
MonstarC.add(monstar);
crossCurser = loadImage("cross_curser.png");
curser = false;
SHAPE = null;
selectSwitch = true;
resizeSwitchPlus = false;
resetSwitch = false;
}//end setup
void startScreen() {
image(bkg2, 0, 0); //¸.·´¯`·.´¯`·.¸
//background(00000);
fill(0); //FF6600
text("D.E.G", width/2-10, 100);
fill(38,34,98); //FF6600
text("[ Press SHIFT to continue ]", width/2-70,150);
fill(255);
if (keyPressed) {
if (key == CODED) {
if (keyCode == SHIFT) {
gamecontrol = 5;
}
}
}
}
void gameOver() {
image(gameoverbg, 0, 0); //¸.·´¯`·.´¯`·.¸
fill(255,0,0);
println ("game over");
text(" G A M E O V E R ", width/2, height/2);
fill(255);
noLoop();
} // end gameover
void wingame() {
image(wingamebg, 0, 0); //¸.·´¯`·.´¯`·.¸
fill(0);
println ("win");
text("You Win!", width/2, height/2);
fill(255);
noLoop();
}// end win game
void pickLevel() {
image(levelselectbg, 0, 0); //¸.·´¯`·.´¯`·.¸
println ("levels");
text("Pick Your Level", 170, 100);
fill(30,30,120);
text( "EASY" + " " + "Press 'E' on your keyboard ", 110, 150);
text( "MEDIUM" + " " + "Press 'M' on your keyboard ", 105, 170);
text( "HARD" + " " + "Press 'H' on your keyboard ", 110, 190);