Hey guys. Sorry for another noob post. I'm still working on my brickbreaker game, but i'm having a bit of trouble figuring out how to set up levels, basically. Right now, i've got loading a square of bricks.

1 2 3 4 5 6 7 8 9 10 11 12 13 14

publicvoidloadBricks() {inti = 0;

for(intj= 0; j < 5;j++) {for (intk = 0;k < 5; k++) {

bricks[i] = newBrick(0,j*32+100,k*16 + 400);i++;

}

}

}

Very basic as you see and definitely doesn't do what I need it to do. This is in my game.java class.

you have 2 x int[][] board. one is a class member, the other one is a local variable in the constructor.you only fill the local variable, but then you use the class member, which will only contain 0's.

Edit: Basically, in the code you have, you create a whole new board array in your Level constructor, instead of setting the global board array. So the global board array you declared in the Level class outside the constructor was always filled with zeros since you initialized it to a blank array. If you change what I showed you, you'll be accessing the global board variable and setting all its contents to ones.

Edit: Basically, in the code you have, you create a whole new board array in your Level constructor, instead of setting the global board array. So the global board array you declared in the Level class outside the constructor was always filled with zeros since you initialized it to a blank array. If you change what I showed you, you'll be accessing the global board variable and setting all its contents to ones.

When I do that, I get an error on the board variable saying "Syntax error on token "board", VariableDeclaratorId expected after this token"

I even took a bunch of the variables out and replaced with numbers because I was getting errors. It seems like something is wrong..

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org