First post here, probably wont be my last.
I have a major assignment due and we were supplied with a task and code to go with it. The assignment is basically to recreate pacman. I am stuck with it, as when all the markers are removed it is meant to automatically load up a new "map/level". It is written in java and we are using Greenfoot as the application/compiler if that helps.
public final char[][] LEVEL_1 = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','.','.','.','.','.','.','.','.','#','.','.','.','.','.','.','.','.','#'},
{'#','$','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','$','#'},
{'#','.','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','.','#'},
{'#','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','#'},
{'#','.','#','#','.','#','.','#','#','#','#','#','.','#','.','#','#','.','#'},
{'#','.','.','.','.','#','.','.','.','#','.','.','.','#','.','.','.','.','#'},
{'#','#','#','#','.','#','#','#',' ','#',' ','#','#','#','.','#','#','#','#'},
{' ',' ',' ','#','.','#',' ',' ',' ',' ',' ',' ',' ','#','.','#',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','|','#','#',' ','#','.','#','#','#','#'},
{' ',' ',' ',' ','.',' ',' ','#','%','?','%','#',' ',' ','.',' ',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','#','#','#',' ','#','.','#','#','#','#'},
{' ',' ',' ','#','.','#',' ',' ',' ',' ',' ',' ',' ','#','.','#',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','#','#','#',' ','#','.','#','#','#','#'},
{'#','.','.','.','.','.','.','.','.','#','.','.','.','.','.','.','.','.','#'},
{'#','.','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','.','#'},
{'#','$','.','#','.','.','.','.','.','@','.','.','.','.','.','#','.','$','#'},
{'#','#','.','#','.','#','.','#','#','#','#','#','.','#','.','#','.','#','#'},
{'#','.','.','.','.','#','.','.','.','#','.','.','.','#','.','.','.','.','#'},
{'#','.','#','#','#','#','#','#','.','#','.','#','#','#','#','#','#','.','#'},
{'#','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'}
},
LEVEL_2 = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#','#','#','#','.','.','.','#','.','.','.','.','.','.','.','.','#'},
{'#','$','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','$','#'},
{'#','.','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','.','#'},
{'#','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','#'},
{'#','.','#','#','.','#','.','#','#','#','#','#','.','#','.','#','#','.','#'},
{'#','.','.','.','.','#','.','.','.','#','.','.','.','#','.','.','.','.','#'},
{'#','#','#','#','.','#','#','#',' ','#',' ','#','#','#','.','#','#','#','#'},
{' ',' ',' ','#','.','#',' ',' ',' ',' ',' ',' ',' ','#','.','#',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','|','#','#',' ','#','.','#','#','#','#'},
{' ',' ',' ',' ','.',' ',' ','#','%','?','%','#',' ',' ','.',' ',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','#','#','#',' ','#','.','#','#','#','#'},
{' ',' ',' ','#','.','#',' ',' ',' ',' ',' ',' ',' ','#','.','#',' ',' ',' '},
{'#','#','#','#','.','#',' ','#','#','#','#','#',' ','#','.','#','#','#','#'},
{'#','.','.','.','.','.','.','.','.','#','.','.','.','.','.','.','.','.','#'},
{'#','.','#','#','.','#','#','#','.','#','.','#','#','#','.','#','#','.','#'},
{'#','$','.','#','.','.','.','.','.','@','.','.','.','.','.','#','.','$','#'},
{'#','#','.','#','.','#','.','#','#','#','#','#','.','#','.','#','.','#','#'},
{'#','.','.','.','.','#','.','.','.','#','.','.','.','#','.','.','.','.','#'},
{'#','.','#','#','#','#','#','#','.','#','.','#','#','#','#','#','#','.','#'},
{'#','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'}
};
That is how the levels are designed (LEVEL_2 wasn't changed as much as I just wanted to test and get switching done before putting effort in), as far as I know it is a two dimensional char array.
There is a pre-written method advanceToLevel(char[][])
which requires the input of the name of an array, in this case when I trigger the map change I want LEVEL_2 to be selected, but I am unsure how to have it select LEVEL_2 or anything else that I choose to create.
Anything I try keeps throwing up that it can't convert a string to char[][].
Any help would be appreciated.