need help creating a maze program
Hi everyone!
Im new to the forum and this is my first post. I want to create a maze where i am able to move around with a dot. But i cant even create the maze it only shows a blank window and im rly confused in what to do.
So i hope u can help me, correct the code for me and tell me what do to next.
I would rly appreciate the help and ty in advance.
btw im a beginner so try to make it as simple as possible ty...
My code this far is:
Code java:
class Mazegame {
public static void main(String[] args) {
new Mazegame().run();
}
void run() {
Game game = new Game();
game.run();
}
}
class Game {
private DotWindow w;
private int width;
private int height;
public void run() {
setup();
}
private void setup() {
w = new DotWindow(50, 50, 10);
w.setDot(0, 25, Color.RED);
generate(width, height);
}
private void generate(int width, int height) {
width = Keyboard.nextInt("ange bredd: ");
height = Keyboard.nextInt("ange höjd: ");
int[][] maze = MazeGenerator.generate(width, height);
for(int x = 1; x < width - 1; x++) {
for(int y = 1; y < height - 1; y++) {
}
}
}
}
Re: need help creating a maze program
For future reference, please use the format your code to make it readable (read the announcements post at the top of every forum for instructions - I've edited your post this time).
You've posted a limited amount of code for us to help out. The window class that isn't posted is important in diagnosing the problem