home *** CD-ROM | disk | FTP | other *** search
- function createBoxes()
- {
- y = 1;
- while(rows >= y)
- {
- x = 1;
- while(cols >= x)
- {
- duplicateMovieClip("Box","Box" + x + "_" + y,16384 + eval("/:zIndex"));
- setProperty("Box" + x + "_" + y, _X, Box._x + (x - 1) * (Box._width + 2));
- setProperty("Box" + x + "_" + y, _Y, Box._y + (y - 1) * (Box._height + 2));
- §/:zIndex§++;
- x++;
- }
- y++;
- }
- }
- function startGame()
- {
- stopAllSounds();
- Title._visible = 0;
- Text3D.write("GET READY!",65,135);
- Sounds.gotoAndPlay("Start");
- Music.gotoAndPlay(5);
- GamePiece.start(startX,startY);
- BG.gotoAndStop(1);
- gameRunning = true;
- removedLines = 0;
- level = 1;
- score = 0;
- speed = userSpeed;
- c = 0;
- while(c < linesAtStart)
- {
- x = 1;
- while(cols >= x)
- {
- if(int(Math.random() * 2) + 1 == 2)
- {
- eval("Box" + x + "_" + (rows - c)).gotoAndStop(2);
- eval("Box" + x + "_" + (rows - c)).Brick.gotoAndStop(int(Math.random() * 9) + 1);
- eval("Box" + x + "_" + (rows - c)).filled = true;
- }
- x++;
- }
- c++;
- }
- }
- function showTitle()
- {
- Title._visible = 1;
- Options._visible = 0;
- Options.gotoAndStop(1);
- Title.gotoAndPlay(1);
- Music.gotoAndPlay("Title");
- }
- function highScoreSort(scoresArray, playersArray)
- {
- i = eval("_root." + scoresArray).length - 2;
- while(i >= 0)
- {
- j = 0;
- while(i >= j)
- {
- if(eval("_root." + scoresArray)[j] < eval("_root." + scoresArray)[j + 1])
- {
- temp1 = eval("_root." + scoresArray)[j];
- temp2 = eval("_root." + playersArray)[j];
- eval("_root." + scoresArray)[j] = eval("_root." + scoresArray)[j + 1];
- eval("_root." + playersArray)[j] = eval("_root." + playersArray)[j + 1];
- eval("_root." + scoresArray)[j + 1] = temp1;
- eval("_root." + playersArray)[j + 1] = temp2;
- }
- j++;
- }
- i--;
- }
- }
-