How would it be possible to create a 2D array of characters in Java? I've researching this as applicable to my goal of a map you can move a character around on, though have not found anything helpful. I have done this (with a little help) in C++ before, though don't know how to in Java.
For the C++ version, I started with a 1D array of strings:
"#######.#.~~~####.##.......~~~..##.~~....H....######..#######",
"#####..T.#~~~..##.H......~~~...#..T.~~.........######.###....",
"######..~~~~#######...#..~~~.........~~~.##.###..#####.###...",
"...###..~~~.######...##H.~~~.@........~~.#.####...##.H.###...",
".#####..~~.~~###C.....#..~~~.....#...~~~..###..#....##....#..",
"######....~~~.~.##....#..~~~.....#....~~~.#######C...........",
"#######.H..~.~~~~#....#..~~~.....###...~~~.##########........",
"########.H...~~~~~.....~~~......H..##....~~~.H######...T...##",
(You are the @ Symbol) And then was able to break each string up into separate characters with 2 nested for loops that broke it into what was basically a 2D array that you could move your character around in.
Is this a good way of doing it, if so how? (I've spent 10 hours now attempting to get a basic version to work). Is there a better way of doing this? I would like to create a very complex game later on with a map like this, but need help coming up with how.