home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / flashbox.swf / scripts / DefineSprite_140 / frame_6 / DoAction.as
Encoding:
Text File  |  2006-09-05  |  2.2 KB  |  136 lines

  1. score += Drop;
  2. Drop = "0";
  3. PieceType = NextPieceType;
  4. Color = NextPieceType;
  5. NextPieceType = int(random(NumPieceTypes));
  6. gotoAndStop("NextPieceIndicator:" add (NextPieceType + "1"));
  7. if(PieceType == "0")
  8. {
  9.    x_1 = "0";
  10.    y_1 = "0";
  11.    x_2 = - "1";
  12.    y_2 = "0";
  13.    x_3 = "0";
  14.    y_3 = - "1";
  15.    x_4 = "0";
  16.    y_4 = - "2";
  17.    PieceY = PieceStartY + "2";
  18. }
  19. else if(PieceType == "1")
  20. {
  21.    x_1 = "0";
  22.    y_1 = "0";
  23.    x_2 = - "1";
  24.    y_2 = "0";
  25.    x_3 = "1";
  26.    y_3 = "0";
  27.    x_4 = "0";
  28.    y_4 = - "1";
  29.    PieceY = PieceStartY + "1";
  30. }
  31. else if(PieceType == "2")
  32. {
  33.    x_1 = "0";
  34.    y_1 = "0";
  35.    x_2 = "1";
  36.    y_2 = "0";
  37.    x_3 = "0";
  38.    y_3 = "1";
  39.    x_4 = "1";
  40.    y_4 = "1";
  41.    PieceY = PieceStartY;
  42. }
  43. else if(PieceType == "3")
  44. {
  45.    x_1 = "0";
  46.    y_1 = - "1";
  47.    x_2 = "0";
  48.    y_2 = "0";
  49.    x_3 = "0";
  50.    y_3 = "1";
  51.    x_4 = "0";
  52.    y_4 = "2";
  53.    PieceY = PieceStartY + "1";
  54. }
  55. else if(PieceType == "4")
  56. {
  57.    x_1 = "0";
  58.    y_1 = "0";
  59.    x_2 = - "1";
  60.    y_2 = "0";
  61.    x_3 = - "1";
  62.    y_3 = "1";
  63.    x_4 = "0";
  64.    y_4 = - "1";
  65.    PieceY = PieceStartY + "1";
  66. }
  67. else if(PieceType == "5")
  68. {
  69.    x_1 = "0";
  70.    y_1 = "0";
  71.    x_2 = "1";
  72.    y_2 = "0";
  73.    x_3 = "0";
  74.    y_3 = - "1";
  75.    x_4 = "0";
  76.    y_4 = - "2";
  77.    PieceY = PieceStartY + "2";
  78. }
  79. else if(PieceType == "6")
  80. {
  81.    x_1 = "0";
  82.    y_1 = "0";
  83.    x_2 = "1";
  84.    y_2 = "0";
  85.    x_3 = "1";
  86.    y_3 = "1";
  87.    x_4 = "0";
  88.    y_4 = - "1";
  89.    PieceY = PieceStartY + "1";
  90. }
  91. if(Color == "0")
  92. {
  93.    BlockName = "GreyBlock";
  94. }
  95. else if(Color == "1")
  96. {
  97.    BlockName = "YellowBlock";
  98. }
  99. else if(Color == "2")
  100. {
  101.    BlockName = "BlueBlock";
  102. }
  103. else if(Color == "3")
  104. {
  105.    BlockName = "RedBlock";
  106. }
  107. else if(Color == "4")
  108. {
  109.    BlockName = "CyanBlock";
  110. }
  111. else if(Color == "5")
  112. {
  113.    BlockName = "MagentaBlock";
  114. }
  115. else if(Color == "6")
  116. {
  117.    BlockName = "GreenBlock";
  118. }
  119. i = "1";
  120. PieceX = PieceStartX;
  121. while("4" >= i)
  122. {
  123.    duplicateMovieClip(BlockName,"Block" add i,"100" + i + 16384);
  124.    set("x_" add i,eval("x_" add i) + PieceX);
  125.    set("y_" add i,eval("y_" add i) + PieceY);
  126.    i += "1";
  127. }
  128. MoveMode = "Translate";
  129. XDelta = "0";
  130. YDelta = "0";
  131. call("MovePiece");
  132. if(!Moved)
  133. {
  134.    call("GameOver");
  135. }
  136.