Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/03/2010, 13:29
mangekyo
 
Fecha de Ingreso: marzo-2010
Mensajes: 8
Antigüedad: 14 años, 1 mes
Puntos: 1
ayuda con codigo para maze(laberinto) en juego en flash

encontre este codigo en la web para hacer un mapa de laberinto para juego de pacman en esta direccion:
http://keepdsmile.com/stuff/pacman.php
y este es el codigo para crear el maze pero yo quiero que mi maze tenga formato horizontal y tenga medidas especificas:
Código:
m =
"############################"+
"#............##............#"+
"#.####.#####.##.#####.####.#"+
"#O####.#####.##.#####.####O#"+
"#.####.#####.##.#####.####.#"+
"#..........................#"+
"#.####.##.########.##.####.#"+
"#.####.##.########.##.####.#"+
"#......##....##....##......#"+
"######.##### ## #####.######"+
"######.##### ## #####.######"+
"######.##          ##.######"+
"######.## ######## ##.######"+
"######.## # # # ## ##.######"+
"L     .   # # # ##   .     R"+
"######.## ### #### ##.######"+
"######.## ######## ##.######"+
"######.##          ##.######"+
"######.## ######## ##.######"+
"######.## ######## ##.######"+
"#............##............#"+
"#.####.#####.##.#####.####.#"+
"#.####.#####.##.#####.####.#"+
"#O..##.......  .......##..O#"+
"###.##.##.########.##.##.###"+
"###.##.##.########.##.##.###"+
"#......##....##....##......#"+
"#.##########.##.##########.#"+
"#.##########.##.##########.#"+
"#............##............#"+
"############################";

// Set up Maze array
for (i=-1; i<29; i++) {
	Maze.attachMovie("Empty", i, i+1);
}

// Set up components of array and draw pills/ajusta componentes de array y dibuja las pildoras
pos = 0;
for (j=0; j<31; j++) {
	for (i=0; i<28; i++) {
		Maze[i][j] = m.charAt(pos++);
		pill = false;
		if (Maze[i][j] == ".") {
			pill = true;
			Maze[i].attachMovie("Pill", "P"+j, pos);
		}
		if (Maze[i][j] == "O") {
			pill = true;
			Maze[i].attachMovie("Power", "P"+j, pos);
		}
		if (pill) {
			with (Maze[i]["P"+j]) {
				_x = OFFX + 12*i;
				_y = OFFY + 12*j;
			}
		}
	}
}
que codigos devo cambiar para poder construir mi maze como yo lo quiera?
gracias. o tambien me serviria un tuto para aprender mas de ese metodo para crear mazes.