All pastes #559096 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-11 17:02 UTC
rendered paste body
#include "arkanoid.as"

var mapLvl1:Array =
[[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1]];


var mapLvl2:Array =
[[1,1,1,1,1,1,0,1,0,1,1,0,1,0,2,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1],
[1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1]];

mapLvls = [mapLvl1, mapLvl2];

var iX = 0 ;
var iY = 0;
var iBrickID = 0;

// Load bricks using an external bricks file (default bricks.ascii)
function loadBricks()
{
	var mapLvlRoot:Array = mapLvls[currentLevel];
	
	while(iY < 5)
	{
		while(iX < 20)
		{
			switch(mapLvlRoot[iY][iX])
			{
				case 0:
				break;
				case 1:
				
					iBrickID = (iY*100) + iX;
					
					
					duplicateMovieClip(BriqueJaune, "BriqueJaune"+iBrickID, iBrickID);
					
					this["BriqueJaune"+iBrickID]._x = getProperty(_root.Brick, _x) + (iX * 30);
					this["BriqueJaune"+iBrickID]._y = getProperty(_root.Brick, _y) + (iY * 30);
					this["BriqueJaune"+iBrickID]._visible = true;					
					/*
					briqueJaune._x = getProperty(_root.Brick, _x) + (iX * 30);
					briqueJaune._y = getProperty(_root.Brick, _y) + (iY * 30);
					briqueJaune._visible = true;					*/
					
				break;
				// for different colors create more case here :
			}
		iX++;
		}
		
		iX = 0;
		iY++;
	}
}