I am writing a maze program for school. I am using a 2d array to represent to location of walls for the maze. The background (for figuring out where a player can move) is not the problem.
I am using this algorithm for places the images…
for (i = 0; i < 22; i++) {[INDENT]for (j = 0; j < 16; j++) {[INDENT]if (maze*[j] == 1) {[INDENT]instanceName = “wall” add i add j; //for multiple names for each instance
duplicateMovieClip(“wall”, newname = “instanceName”, 1);
setProperty(“instanceName”, _x, (25i+13));
setProperty(“instanceName”, _y, (25j+13));
[/INDENT]}
[/INDENT]}
[/INDENT]}
What needs to be done to use many copies of one instance to build the visible part of my maze? I want to be able to have all pieces anmed “wall” instead of “wall1”, “wall2”, etc…which isn’t working anyway.
Please respond!