Section 1
//barLoadCompleteCFG_8 (main_fla.barLoadCompleteCFG_8)
package main_fla {
import flash.display.*;
import flash.text.*;
public dynamic class barLoadCompleteCFG_8 extends MovieClip {
public var txtbox:TextField;
public var barLoad:MovieClip;
public function barLoadCompleteCFG_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package main_fla
Section 2
//EYEMARKER_28 (main_fla.EYEMARKER_28)
package main_fla {
import flash.display.*;
public dynamic class EYEMARKER_28 extends MovieClip {
public var temp;
public function EYEMARKER_28(){
addFrameScript(18, frame19, 28, frame29, 38, frame39, 48, frame49, 58, frame59, 68, frame69);
}
function frame19(){
temp = Math.floor((Math.random() * 30));
if ((((temp > 0)) && ((temp < 7)))){
gotoAndPlay(("blink" + temp));
} else {
gotoAndPlay(1);
};
}
function frame29(){
gotoAndPlay(1);
}
function frame39(){
gotoAndPlay(1);
}
function frame49(){
gotoAndPlay(1);
}
function frame59(){
gotoAndPlay(1);
}
function frame69(){
gotoAndPlay(1);
}
}
}//package main_fla
Section 3
//gamefield_29 (main_fla.gamefield_29)
package main_fla {
import flash.display.*;
public dynamic class gamefield_29 extends MovieClip {
public var tile_14_0:MovieClip;
public var tile_14_1:MovieClip;
public var tile_14_2:MovieClip;
public var tile_14_4:MovieClip;
public var tile_14_5:MovieClip;
public var tile_14_6:MovieClip;
public var tile_14_7:MovieClip;
public var tile_14_3:MovieClip;
public var tile_3_3:MovieClip;
public var tile_3_4:MovieClip;
public var tile_3_2:MovieClip;
public var tile_3_6:MovieClip;
public var tile_3_7:MovieClip;
public var tile_3_1:MovieClip;
public var tile_3_5:MovieClip;
public var tile_3_0:MovieClip;
public var tile_13_0:MovieClip;
public var tile_13_1:MovieClip;
public var tile_13_2:MovieClip;
public var tile_13_4:MovieClip;
public var tile_13_5:MovieClip;
public var tile_13_7:MovieClip;
public var tile_2_5:MovieClip;
public var tile_2_6:MovieClip;
public var tile_2_7:MovieClip;
public var tile_2_2:MovieClip;
public var tile_2_4:MovieClip;
public var tile_13_3:MovieClip;
public var tile_2_0:MovieClip;
public var tile_13_6:MovieClip;
public var tile_2_1:MovieClip;
public var tile_2_3:MovieClip;
public var tile_12_0:MovieClip;
public var tile_12_1:MovieClip;
public var tile_12_3:MovieClip;
public var tile_12_4:MovieClip;
public var tile_12_2:MovieClip;
public var tile_12_6:MovieClip;
public var tile_12_7:MovieClip;
public var tile_1_5:MovieClip;
public var tile_1_6:MovieClip;
public var tile_1_7:MovieClip;
public var tile_1_1:MovieClip;
public var tile_1_2:MovieClip;
public var tile_1_3:MovieClip;
public var tile_1_4:MovieClip;
public var tile_9_5:MovieClip;
public var tile_9_6:MovieClip;
public var tile_9_7:MovieClip;
public var tile_1_0:MovieClip;
public var tile_9_3:MovieClip;
public var tile_9_4:MovieClip;
public var tile_11_0:MovieClip;
public var tile_11_1:MovieClip;
public var tile_11_2:MovieClip;
public var tile_11_3:MovieClip;
public var tile_11_4:MovieClip;
public var tile_11_5:MovieClip;
public var tile_11_7:MovieClip;
public var tile_12_5:MovieClip;
public var tile_11_6:MovieClip;
public var tile_0_0:MovieClip;
public var tile_0_1:MovieClip;
public var tile_0_2:MovieClip;
public var tile_0_3:MovieClip;
public var tile_0_4:MovieClip;
public var tile_0_5:MovieClip;
public var tile_0_6:MovieClip;
public var tile_0_7:MovieClip;
public var tile_8_1:MovieClip;
public var tile_8_2:MovieClip;
public var tile_8_3:MovieClip;
public var tile_8_5:MovieClip;
public var tile_8_6:MovieClip;
public var tile_9_1:MovieClip;
public var tile_9_2:MovieClip;
public var tile_8_7:MovieClip;
public var tile_8_0:MovieClip;
public var tile_8_4:MovieClip;
public var tile_9_0:MovieClip;
public var tile_10_0:MovieClip;
public var tile_10_1:MovieClip;
public var tile_10_3:MovieClip;
public var tile_10_4:MovieClip;
public var tile_10_7:MovieClip;
public var tile_10_5:MovieClip;
public var tile_10_6:MovieClip;
public var tile_7_3:MovieClip;
public var tile_7_4:MovieClip;
public var tile_7_5:MovieClip;
public var tile_7_0:MovieClip;
public var tile_7_2:MovieClip;
public var tile_7_7:MovieClip;
public var tile_7_1:MovieClip;
public var tile_6_0:MovieClip;
public var tile_6_1:MovieClip;
public var tile_6_2:MovieClip;
public var tile_6_4:MovieClip;
public var tile_6_5:MovieClip;
public var tile_6_7:MovieClip;
public var tile_6_6:MovieClip;
public var tile_10_2:MovieClip;
public var tile_6_3:MovieClip;
public var tile_5_2:MovieClip;
public var tile_5_3:MovieClip;
public var tile_5_5:MovieClip;
public var tile_5_0:MovieClip;
public var tile_5_1:MovieClip;
public var tile_5_7:MovieClip;
public var tile_15_2:MovieClip;
public var tile_15_3:MovieClip;
public var tile_15_4:MovieClip;
public var tile_15_6:MovieClip;
public var tile_15_0:MovieClip;
public var tile_15_1:MovieClip;
public var tile_15_5:MovieClip;
public var tile_4_0:MovieClip;
public var tile_4_1:MovieClip;
public var tile_4_2:MovieClip;
public var tile_4_3:MovieClip;
public var tile_4_4:MovieClip;
public var tile_4_5:MovieClip;
public var tile_4_7:MovieClip;
public var tile_5_6:MovieClip;
public var tile_15_7:MovieClip;
public var tile_4_6:MovieClip;
public var tile_7_6:MovieClip;
public var tile_5_4:MovieClip;
}
}//package main_fla
Section 4
//logoCFG_3 (main_fla.logoCFG_3)
package main_fla {
import flash.display.*;
public dynamic class logoCFG_3 extends MovieClip {
public function logoCFG_3(){
addFrameScript(0, frame1, 151, frame152);
}
function frame152(){
stop();
}
function frame1(){
stop();
}
}
}//package main_fla
Section 5
//MainTimeline (main_fla.MainTimeline)
package main_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var txt_score:TextField;
public var btn_slow:SimpleButton;
public var scoreMultiplyer:Number;
public var win_MP1:Boolean;
public var canFlip_MP1:Boolean;
public var btn_song2:SimpleButton;
public var win_MP2:Boolean;
public var canFlip_MP2:Boolean;
public var btn_song1:SimpleButton;
public var btn_BackToMenu:SimpleButton;
public var music:Number;
public var moveSpeed_MP2:Number;
public var moveSpeed_MP1:Number;
public var gameArray_MP1:Array;
public var gameArray_MP2:Array;
public var lastMove_MP2:Number;
public var lastMove_MP1:Number;
public var btn_PlayAgain:SimpleButton;
public var start_message_MP1:MovieClip;
public var next2_MP1:MovieClip;
public var btn_fast:SimpleButton;
public var start_message_MP2:MovieClip;
public var gameArea_MP1:MovieClip;
public var next2_MP2:MovieClip;
public var speed:Number;
public var gameArea_MP2:MovieClip;
public var btn_SinglePlayer:SimpleButton;
public var canFlip:Boolean;
public var preloader:MovieClip;
public var quickDrop:Boolean;
public var color1_MP2:Number;
public var color1_MP1:Number;
public var percentage:Number;
public var lastDrop_MP2:Number;
public var score:Number;
public var lastDrop_MP1:Number;
public var lastDrop:Number;
public var quickDrop_MP2:Boolean;
public var txt_gameover:TextField;
public var btn_medium:SimpleButton;
public var btn_increase:SimpleButton;
public var txt_explanation:TextField;
public var ncolor2_MP1:Number;
public var next1_MP1:MovieClip;
public var next1_MP2:MovieClip;
public var newScore:Number;
public var btn_GameOn:SimpleButton;
public var speed_selector:MovieClip;
public var MOVE_DELTA_MP1:Number;
public var MOVE_DELTA_MP2:Number;
public var ncolor2_MP2:Number;
public var txt_greenVirus:TextField;
public var gameEnabled:Boolean;
public var quickDrop_MP1:Boolean;
public var txt_level:TextField;
public var moveSpeed:Number;
public var timer_MP2:Timer;
public var button_titlebranding:SimpleButton;
public var btn_TryAgain:SimpleButton;
public var Pill_MP2:Object;
public var song:Sound;
public var sound_machine:MovieClip;
public var ncolor1:Number;
public var start_message:MovieClip;
public var ncolor2:Number;
public var color1:Number;
public var color2:Number;
public var btn_decrease:SimpleButton;
public var timer_MP1:Timer;
public var timer2_MP2:Timer;
public var btn_play:SimpleButton;
public var timer:Timer;
public var Pill_MP1:Object;
public var multiplayer:Boolean;
public var btn_Help:SimpleButton;
public var ncolor_MP2:Number;
public var timer2_MP1:Timer;
public var ncolor_MP1:Number;
public var Pill:Object;
public var level:Number;
public var gameArray:Array;
public var lastMove:Number;
public var next1:MovieClip;
public var next2:MovieClip;
public var gameArea:MovieClip;
public var MOVE_DELTA:Number;
public var gameEnabled_MP1:Boolean;
public var timer2:Timer;
public var txt_blueVirus:TextField;
public var gameEnabled_MP2:Boolean;
public var song_selector:MovieClip;
public var txt_redVirus:TextField;
public var win:Boolean;
public var color2_MP1:Number;
public var color2_MP2:Number;
public var btn_MultiPlayer:SimpleButton;
public var btn_song_none:SimpleButton;
public function MainTimeline(){
addFrameScript(0, frame1, 19, frame20, 29, frame30, 39, frame40, 49, frame50, 59, frame60, 69, frame70, 79, frame80, 89, frame90);
}
public function display_MP1():void{
var val:Number;
var ref:MovieClip;
var i:int;
var j:int;
i = 0;
while (i < (gameArray_MP1.length - 1)) {
j = 0;
while (j < gameArray_MP1[0].length) {
val = gameArray_MP1[i][j];
ref = gameArea_MP1[((("tile_" + i) + "_") + j)];
ref.gotoAndStop((val + 1));
if ((((val >= 4)) && ((val <= 6)))){
var _local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
if (val >= 10){
if (j > 0){
if (gameArray_MP1[i][(j - 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = -1;
_scaleY = 1;
};
};
};
if (j < 7){
if (gameArray_MP1[i][(j + 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
};
if (i > 0){
if (gameArray_MP1[(i - 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_scaleX = 1;
_scaleY = 1;
_rota = -90;
};
};
};
if (i < 15){
if (gameArray_MP1[(i + 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_rota = 90;
_scaleX = 1;
_scaleY = -1;
};
};
};
};
j = (j + 1);
};
i = (i + 1);
};
}
public function BitmapTransition():void{
var bitmapdata:BitmapData;
var bitmapMC:*;
var i:int;
var filter:DropShadowFilter;
var ef:Function;
var j:int;
var rectangle:Rectangle;
var bitmapdata2:BitmapData;
var bitmap:*;
var flyingBlock:MovieClip;
ef = function (_arg1:Event):void{
_arg1.target.rotation = (_arg1.target.rotation + (_arg1.target.xSpd / 2));
_arg1.target.x = (_arg1.target.x + _arg1.target.xSpd);
_arg1.target.y = (_arg1.target.y + _arg1.target.ySpd);
_arg1.target.ySpd = (_arg1.target.ySpd + 0.5);
if (_arg1.target.y >= 520){
bitmapMC.removeChild(DisplayObject(_arg1.target));
_arg1.target.removeEventListener(Event.ENTER_FRAME, ef);
};
};
bitmapdata = new BitmapData(550, 500, false);
bitmapdata.draw(stage, new Matrix());
bitmapMC = new MovieClip();
stage.addChild(bitmapMC);
i = 0;
while (i < 22) {
j = 0;
while (j < 20) {
rectangle = new Rectangle((25 * i), (25 * j), 25, 25);
bitmapdata2 = new BitmapData(25, 25, false);
bitmapdata2.copyPixels(bitmapdata, rectangle, new Point(0, 0));
bitmap = new Bitmap(bitmapdata2);
flyingBlock = new MovieClip();
flyingBlock.addChild(bitmap);
bitmapMC.addChild(flyingBlock);
flyingBlock.x = (i * 25);
flyingBlock.y = (j * 25);
flyingBlock.xSpd = ((Math.random() * 10) - 5);
flyingBlock.ySpd = ((Math.random() * 20) - 15);
flyingBlock.addEventListener(Event.ENTER_FRAME, ef);
j = (j + 1);
};
i = (i + 1);
};
filter = new DropShadowFilter(20, 45, 0, 0.3, 0, 0, 1, 1);
bitmapMC.filters = [filter];
}
public function checkClears_MP1():Boolean{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = true;
_local5 = false;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = [];
_local10 = [];
while (_local4) {
_local4 = false;
_local11 = 0;
while (_local11 < (gameArray_MP1.length - 1)) {
_local12 = 0;
while (_local12 < gameArray_MP1[0].length) {
_local2 = _local11;
_local3 = 0;
_local1 = (gameArray_MP1[_local2][_local12] % 3);
switch (gameArray_MP1[_local2][_local12]){
case 1:
_local6++;
break;
case 2:
_local7++;
break;
case 3:
_local8++;
break;
};
_local9.push(_local2);
_local10.push(_local12);
while (((((!((gameArray_MP1[_local2][_local12] == 0))) && (((gameArray_MP1[_local2][_local12] % 3) == _local1)))) && ((_local2 < 16)))) {
_local9.push(_local2);
_local10.push(_local12);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic_MP1(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
_local9 = [];
_local10 = [];
_local11 = 0;
while (_local11 < (gameArray_MP1.length - 1)) {
_local12 = 0;
while (_local12 < gameArray_MP1[0].length) {
_local2 = _local12;
_local3 = 0;
_local1 = (gameArray_MP1[_local11][_local2] % 3);
_local9.push(_local11);
_local10.push(_local2);
while (((((!((gameArray_MP1[_local11][_local2] == 0))) && (((gameArray_MP1[_local11][_local2] % 3) == _local1)))) && ((_local2 < 8)))) {
_local9.push(_local11);
_local10.push(_local2);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic_MP1(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
if (_local4){
_local5 = true;
};
};
if (((_local6 + _local7) + _local8) == 0){
win_MP1 = true;
death_MP();
};
if (_local5){
gameEnabled_MP1 = false;
timer_MP1.stop();
timer2_MP1.start();
};
return (_local5);
}
public function checkClears_MP2():Boolean{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = true;
_local5 = false;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = [];
_local10 = [];
while (_local4) {
_local4 = false;
_local11 = 0;
while (_local11 < (gameArray_MP2.length - 1)) {
_local12 = 0;
while (_local12 < gameArray_MP2[0].length) {
_local2 = _local11;
_local3 = 0;
_local1 = (gameArray_MP2[_local2][_local12] % 3);
switch (gameArray_MP2[_local2][_local12]){
case 1:
_local6++;
break;
case 2:
_local7++;
break;
case 3:
_local8++;
break;
};
_local9.push(_local2);
_local10.push(_local12);
while (((((!((gameArray_MP2[_local2][_local12] == 0))) && (((gameArray_MP2[_local2][_local12] % 3) == _local1)))) && ((_local2 < 16)))) {
_local9.push(_local2);
_local10.push(_local12);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic_MP2(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
_local9 = [];
_local10 = [];
_local11 = 0;
while (_local11 < (gameArray_MP2.length - 1)) {
_local12 = 0;
while (_local12 < gameArray_MP2[0].length) {
_local2 = _local12;
_local3 = 0;
_local1 = (gameArray_MP2[_local11][_local2] % 3);
_local9.push(_local11);
_local10.push(_local2);
while (((((!((gameArray_MP2[_local11][_local2] == 0))) && (((gameArray_MP2[_local11][_local2] % 3) == _local1)))) && ((_local2 < 8)))) {
_local9.push(_local11);
_local10.push(_local2);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic_MP2(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
if (_local4){
_local5 = true;
};
};
if (((_local6 + _local7) + _local8) == 0){
win_MP2 = true;
death_MP();
};
if (_local5){
gameEnabled_MP2 = false;
timer_MP2.stop();
timer2_MP2.start();
};
return (_local5);
}
public function BackToMenu_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
gotoAndStop("MENU");
}
public function snapPill():void{
timer.stop();
moveSpeed = 0;
gameEnabled = false;
quickDrop = false;
renderPill(-6);
timer2.start();
}
public function PlayNextLevel_CLICK(_arg1:MouseEvent):void{
level++;
BitmapTransition();
newScore = score;
gotoAndStop("GAME1P");
}
public function switchPreload():void{
preloader.play_button.visible = true;
preloader.allProgress.visible = false;
preloader.removeEventListener(MouseEvent.MOUSE_DOWN, moregames);
}
public function generateGameArea(_arg1):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Number;
var _local8:int;
_local2 = (4 + (_arg1 * 4));
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = true;
_local7 = 0;
_local8 = 0;
while (_local8 < _local2) {
_local6 = true;
_local3 = (Math.floor((Math.random() * 13)) + 3);
_local4 = Math.floor((Math.random() * 8));
_local7 = Math.ceil((Math.random() * 3));
if (gameArray[_local3][_local4] != 0){
_local6 = false;
};
if (_local3 >= 2){
if ((((gameArray[(_local3 - 1)][_local4] == _local7)) && ((gameArray[(_local3 - 2)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local3 <= 13){
if ((((gameArray[(_local3 + 1)][_local4] == _local7)) && ((gameArray[(_local3 + 2)][_local4] == _local7)))){
_local6 = false;
};
};
if ((((_local3 >= 2)) && ((_local3 <= 13)))){
if ((((gameArray[(_local3 - 1)][_local4] == _local7)) && ((gameArray[(_local3 + 1)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local4 >= 2){
if ((((gameArray[_local3][(_local4 - 1)] == _local7)) && ((gameArray[_local3][(_local4 - 2)] == _local7)))){
_local6 = false;
};
};
if (_local4 <= 5){
if ((((gameArray[_local3][(_local4 + 1)] == _local7)) && ((gameArray[_local3][(_local4 + 2)] == _local7)))){
_local6 = false;
};
};
if ((((_local4 >= 2)) && ((_local4 <= 5)))){
if ((((gameArray[_local3][(_local4 - 1)] == _local7)) && ((gameArray[_local3][(_local4 + 1)] == _local7)))){
_local6 = false;
};
};
if (_local6){
_local8++;
gameArray[_local3][_local4] = _local7;
};
};
display();
}
public function tick2(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
_local2 = true;
_local3 = false;
_local4 = false;
_local5 = 15;
while (_local5 >= 0) {
_local6 = 0;
while (_local6 < 8) {
_local3 = false;
_local4 = false;
if ((((gameArray[_local5][_local6] >= 4)) && ((gameArray[_local5][_local6] <= 6)))){
if ((((_local5 < 15)) && ((gameArray[(_local5 + 1)][_local6] == 0)))){
_local3 = true;
};
} else {
if ((((((gameArray[_local5][_local6] >= 7)) && ((gameArray[_local5][_local6] <= 9)))) && ((_local5 < 15)))){
if ((((((((((_local5 > 0)) && ((gameArray[(_local5 - 1)][_local6] >= 7)))) && ((gameArray[(_local5 - 1)][_local6] <= 9)))) && ((gameArray[(_local5 + 1)][_local6] == 0)))) && ((gameArea[((("tile_" + _local5) + "_") + _local6)]._rota == -90)))){
_local3 = true;
} else {
if ((((gameArray[(_local5 + 1)][_local6] == 0)) && ((gameArea[((("tile_" + _local5) + "_") + _local6)]._rota == 90)))){
_local3 = true;
} else {
if ((((((((gameArray[(_local5 + 1)][_local6] == 0)) && ((gameArray[(_local5 + 1)][(_local6 + 1)] == 0)))) && ((gameArea[((("tile_" + _local5) + "_") + _local6)]._scaleX == 1)))) && ((gameArea[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX == -1)))){
_local3 = true;
_local4 = true;
};
};
};
};
};
if (_local3){
_local2 = false;
gameArray[(_local5 + 1)][_local6] = gameArray[_local5][_local6];
gameArray[_local5][_local6] = 0;
gameArea[((("tile_" + (_local5 + 1)) + "_") + _local6)]._rota = gameArea[((("tile_" + _local5) + "_") + _local6)]._rota;
gameArea[((("tile_" + _local5) + "_") + _local6)]._rota = 0;
gameArea[((("tile_" + (_local5 + 1)) + "_") + _local6)]._scaleX = gameArea[((("tile_" + _local5) + "_") + _local6)]._scaleX;
gameArea[((("tile_" + _local5) + "_") + _local6)]._scaleX = 1;
if (_local4){
gameArray[(_local5 + 1)][(_local6 + 1)] = gameArray[_local5][(_local6 + 1)];
gameArray[_local5][(_local6 + 1)] = 0;
gameArea[((("tile_" + (_local5 + 1)) + "_") + (_local6 + 1))]._scaleX = gameArea[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX;
gameArea[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX = 1;
};
display();
};
_local6++;
};
_local5--;
};
if (_local2){
if (!checkClears()){
addPill();
gameEnabled = true;
timer2.stop();
timer.start();
};
};
}
public function MultiPlayer_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
multiplayer = true;
gotoAndStop("SETTINGS1P");
}
public function initGame_MP1():void{
switch (music){
case 1:
sound_machine = new soundmachine();
addChild(sound_machine);
sound_machine.x = -100;
break;
case 2:
song = new song2();
song.play(0, 99);
break;
};
gameArray_MP1 = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
ncolor_MP1 = (9 + Math.ceil((Math.random() * 3)));
ncolor2_MP1 = (9 + Math.ceil((Math.random() * 3)));
generateGameArea_MP1(level);
checkClears_MP1();
addPill_MP1();
}
public function btn_play_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
if (!multiplayer){
gotoAndStop("GAME1P");
} else {
gotoAndStop("GAME2P");
};
}
public function generateGameArea_MP1(_arg1):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Number;
var _local8:int;
_local2 = (4 + (_arg1 * 4));
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = true;
_local7 = 0;
_local8 = 0;
while (_local8 < _local2) {
_local6 = true;
_local3 = (Math.floor((Math.random() * 13)) + 3);
_local4 = Math.floor((Math.random() * 8));
_local7 = Math.ceil((Math.random() * 3));
if (gameArray_MP1[_local3][_local4] != 0){
_local6 = false;
};
if (_local3 >= 2){
if ((((gameArray_MP1[(_local3 - 1)][_local4] == _local7)) && ((gameArray_MP1[(_local3 - 2)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local3 <= 13){
if ((((gameArray_MP1[(_local3 + 1)][_local4] == _local7)) && ((gameArray_MP1[(_local3 + 2)][_local4] == _local7)))){
_local6 = false;
};
};
if ((((_local3 >= 2)) && ((_local3 <= 13)))){
if ((((gameArray_MP1[(_local3 - 1)][_local4] == _local7)) && ((gameArray_MP1[(_local3 + 1)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local4 >= 2){
if ((((gameArray_MP1[_local3][(_local4 - 1)] == _local7)) && ((gameArray_MP1[_local3][(_local4 - 2)] == _local7)))){
_local6 = false;
};
};
if (_local4 <= 5){
if ((((gameArray_MP1[_local3][(_local4 + 1)] == _local7)) && ((gameArray_MP1[_local3][(_local4 + 2)] == _local7)))){
_local6 = false;
};
};
if ((((_local4 >= 2)) && ((_local4 <= 5)))){
if ((((gameArray_MP1[_local3][(_local4 - 1)] == _local7)) && ((gameArray_MP1[_local3][(_local4 + 1)] == _local7)))){
_local6 = false;
};
};
if (_local6){
_local8++;
gameArray_MP1[_local3][_local4] = _local7;
};
};
display_MP1();
}
public function generateGameArea_MP2(_arg1):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Boolean;
var _local7:Number;
var _local8:int;
_local2 = (4 + (_arg1 * 4));
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = true;
_local7 = 0;
_local8 = 0;
while (_local8 < _local2) {
_local6 = true;
_local3 = (Math.floor((Math.random() * 13)) + 3);
_local4 = Math.floor((Math.random() * 8));
_local7 = Math.ceil((Math.random() * 3));
if (gameArray_MP2[_local3][_local4] != 0){
_local6 = false;
};
if (_local3 >= 2){
if ((((gameArray_MP2[(_local3 - 1)][_local4] == _local7)) && ((gameArray_MP2[(_local3 - 2)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local3 <= 13){
if ((((gameArray_MP2[(_local3 + 1)][_local4] == _local7)) && ((gameArray_MP2[(_local3 + 2)][_local4] == _local7)))){
_local6 = false;
};
};
if ((((_local3 >= 2)) && ((_local3 <= 13)))){
if ((((gameArray_MP2[(_local3 - 1)][_local4] == _local7)) && ((gameArray_MP2[(_local3 + 1)][_local4] == _local7)))){
_local6 = false;
};
};
if (_local4 >= 2){
if ((((gameArray_MP2[_local3][(_local4 - 1)] == _local7)) && ((gameArray_MP2[_local3][(_local4 - 2)] == _local7)))){
_local6 = false;
};
};
if (_local4 <= 5){
if ((((gameArray_MP2[_local3][(_local4 + 1)] == _local7)) && ((gameArray_MP2[_local3][(_local4 + 2)] == _local7)))){
_local6 = false;
};
};
if ((((_local4 >= 2)) && ((_local4 <= 5)))){
if ((((gameArray_MP2[_local3][(_local4 - 1)] == _local7)) && ((gameArray_MP2[_local3][(_local4 + 1)] == _local7)))){
_local6 = false;
};
};
if (_local6){
_local8++;
gameArray_MP2[_local3][_local4] = _local7;
};
};
display_MP2();
}
public function clearPill_MP1():void{
gameArray_MP1[Pill_MP1.i1][Pill_MP1.j1] = 0;
gameArray_MP1[Pill_MP1.i2][Pill_MP1.j2] = 0;
}
public function death():void{
timer.stop();
timer2.stop();
timer.removeEventListener(TimerEvent.TIMER, tick);
timer2.removeEventListener(TimerEvent.TIMER, tick2);
stage.removeEventListener(Event.ENTER_FRAME, enter_Frame);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, controls);
if (music == 1){
removeChild(sound_machine);
};
BitmapTransition();
if (win){
gotoAndStop("GAMEOVERWIN");
} else {
gotoAndStop("GAMEOVER1P");
};
}
public function enter_Frame_MP1(_arg1:Event):void{
if (((((getTimer() - lastMove_MP1) > MOVE_DELTA_MP1)) && (moveSpeed_MP1))){
lastMove_MP1 = getTimer();
movePill_MP1(0, moveSpeed_MP1, false);
};
if (((((getTimer() - lastDrop_MP1) > MOVE_DELTA_MP1)) && (quickDrop_MP1))){
lastDrop_MP1 = getTimer();
movePill_MP1(1, 0, true);
};
}
public function clearPill_MP2():void{
gameArray_MP2[Pill_MP2.i1][Pill_MP2.j1] = 0;
gameArray_MP2[Pill_MP2.i2][Pill_MP2.j2] = 0;
}
public function moregames(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.cuteflashgames.com/");
navigateToURL(_local2);
}
public function enter_Frame_MP2(_arg1:Event):void{
if (((((getTimer() - lastMove_MP2) > MOVE_DELTA_MP2)) && (moveSpeed_MP2))){
lastMove_MP2 = getTimer();
movePill_MP2(0, moveSpeed_MP2, false);
};
if (((((getTimer() - lastDrop_MP2) > MOVE_DELTA_MP2)) && (quickDrop_MP2))){
lastDrop_MP2 = getTimer();
movePill_MP2(1, 0, true);
};
}
function frame1(){
stop();
preloader.stop();
stage.quality = StageQuality.HIGH;
stage.scaleMode = StageScaleMode.NO_SCALE;
preloader.play_button.visible = false;
percentage = 0;
preloader.buttonMode = true;
preloader.useHandCursor = true;
this.addEventListener(Event.ENTER_FRAME, preloading, false, 0, true);
preloader.play_button.addEventListener(MouseEvent.MOUSE_DOWN, go_preload);
preloader.addEventListener(MouseEvent.MOUSE_DOWN, moregames);
}
public function initGame_MP2():void{
var _local1:int;
var _local2:int;
gameArray_MP2 = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
ncolor_MP2 = (9 + Math.ceil((Math.random() * 3)));
ncolor2_MP2 = (9 + Math.ceil((Math.random() * 3)));
generateGameArea_MP2(level);
_local1 = 0;
while (_local1 < (gameArray_MP2.length - 1)) {
_local2 = 0;
while (_local2 < gameArray_MP2[0].length) {
gameArray_MP2[_local1][_local2] = gameArray_MP1[_local1][_local2];
_local2++;
};
_local1++;
};
gameArray_MP2[0][3] = (gameArray_MP2[0][4] = 0);
checkClears_MP2();
addPill_MP2();
}
public function renderPill_MP2(_arg1:Number=0):void{
gameArray_MP2[Pill_MP2.i1][Pill_MP2.j1] = (color1_MP2 + _arg1);
gameArray_MP2[Pill_MP2.i2][Pill_MP2.j2] = (color2_MP2 + _arg1);
}
function frame20(){
stop();
SoundMixer.stopAll();
level = 1;
speed = 900;
score = 0;
music = 1;
newScore = 0;
multiplayer = false;
btn_SinglePlayer.addEventListener(MouseEvent.MOUSE_DOWN, SinglePlayer_CLICK);
btn_MultiPlayer.addEventListener(MouseEvent.MOUSE_DOWN, MultiPlayer_CLICK);
btn_Help.addEventListener(MouseEvent.MOUSE_DOWN, Help_CLICK);
button_titlebranding.addEventListener(MouseEvent.MOUSE_DOWN, moregames);
}
public function addPill_MP1():void{
if (((gameArray_MP1[0][3]) || (gameArray_MP1[0][4]))){
win_MP1 = false;
death_MP();
} else {
quickDrop_MP1 = false;
color1_MP1 = ncolor_MP1;
color2_MP1 = ncolor2_MP1;
ncolor_MP1 = (9 + Math.ceil((Math.random() * 3)));
ncolor2_MP1 = (9 + Math.ceil((Math.random() * 3)));
next1_MP1.gotoAndStop((ncolor_MP1 + 1));
next2_MP1.gotoAndStop((ncolor2_MP1 + 1));
timer_MP1.start();
gameArray_MP1[0][3] = color1_MP1;
gameArray_MP1[0][4] = color2_MP1;
Pill_MP1.i1 = 0;
Pill_MP1.i2 = 0;
Pill_MP1.j1 = 3;
Pill_MP1.j2 = 4;
Pill_MP1.pos = 1;
gameEnabled_MP1 = true;
display_MP1();
};
}
function frame40(){
stop();
SoundMixer.stopAll();
MOVE_DELTA_MP1 = (Math.round((speed / 10)) + 50);
moveSpeed_MP1 = 0;
win_MP1 = true;
canFlip_MP1 = true;
quickDrop_MP1 = false;
lastMove_MP1 = getTimer();
lastDrop_MP1 = getTimer();
timer_MP1 = new Timer(speed, 0);
timer2_MP1 = new Timer(((speed / 6) + 25), 0);
gameEnabled_MP1 = true;
Pill_MP1 = new Object();
color1_MP1 = (9 + Math.ceil((Math.random() * 3)));
color2_MP1 = (9 + Math.ceil((Math.random() * 3)));
initGame_MP1();
stage.addEventListener(KeyboardEvent.KEY_DOWN, gameStart_MP, false, 0, true);
stop();
MOVE_DELTA_MP2 = (Math.round((speed / 10)) + 50);
moveSpeed_MP2 = 0;
win_MP2 = true;
canFlip_MP2 = true;
quickDrop_MP2 = false;
lastMove_MP2 = getTimer();
lastDrop_MP2 = getTimer();
timer_MP2 = new Timer(speed, 0);
timer2_MP2 = new Timer(((speed / 6) + 25), 0);
gameEnabled_MP2 = true;
Pill_MP2 = new Object();
color1_MP2 = (9 + Math.ceil((Math.random() * 3)));
color2_MP2 = (9 + Math.ceil((Math.random() * 3)));
initGame_MP2();
}
public function movePill(_arg1, _arg2, _arg3):void{
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
_local4 = false;
_local5 = false;
_local6 = false;
if (((((((((Pill.i1 + _arg1) > 15)) || (((Pill.i2 + _arg1) > 15)))) || (((Pill.j1 + _arg2) > 7)))) || (((Pill.j2 + _arg2) > 7)))){
_local4 = true;
};
if (((((Pill.j1 + _arg2) < 0)) || (((Pill.j2 + _arg2) < 0)))){
_local4 = true;
};
if (!_local4){
if ((((gameArray[(Pill.i1 + _arg1)][(Pill.j1 + _arg2)] == 0)) || ((gameArray[(Pill.i1 + _arg1)][(Pill.j1 + _arg2)] >= 10)))){
_local5 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
if ((((gameArray[(Pill.i2 + _arg1)][(Pill.j2 + _arg2)] == 0)) || ((gameArray[(Pill.i2 + _arg1)][(Pill.j2 + _arg2)] >= 10)))){
_local6 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
};
if (((((_local5) && (_local6))) && (!(_local4)))){
clearPill();
Pill.i1 = (Pill.i1 + _arg1);
Pill.i2 = (Pill.i2 + _arg1);
Pill.j1 = (Pill.j1 + _arg2);
Pill.j2 = (Pill.j2 + _arg2);
renderPill();
};
if (((_local4) && (_arg3))){
snapPill();
} else {
display();
};
}
function frame30(){
stop();
MOVE_DELTA = (Math.round((speed / 10)) + 50);
moveSpeed = 0;
win = true;
canFlip = true;
quickDrop = false;
lastMove = getTimer();
lastDrop = getTimer();
timer = new Timer(speed, 0);
timer2 = new Timer(((speed / 6) + 25), 0);
gameEnabled = true;
scoreMultiplyer = 1;
Pill = new Object();
color1 = (9 + Math.ceil((Math.random() * 3)));
color2 = (9 + Math.ceil((Math.random() * 3)));
initGame();
stage.addEventListener(KeyboardEvent.KEY_DOWN, gameStart, false, 0, true);
}
public function controls(_arg1:KeyboardEvent):void{
if (gameEnabled){
switch (_arg1.keyCode){
case 37:
moveSpeed = -1;
break;
case 38:
if (canFlip){
canFlip = false;
rotatePill();
};
break;
case 39:
moveSpeed = 1;
break;
case 40:
timer.stop();
quickDrop = true;
break;
};
};
}
public function display():void{
var val:Number;
var ref:MovieClip;
var i:int;
var j:int;
txt_score.text = String(score);
while (txt_score.text.length < 5) {
txt_score.text = ("0" + txt_score.text);
};
i = 0;
while (i < (gameArray.length - 1)) {
j = 0;
while (j < gameArray[0].length) {
val = gameArray[i][j];
ref = gameArea[((("tile_" + i) + "_") + j)];
ref.gotoAndStop((val + 1));
if ((((val >= 4)) && ((val <= 6)))){
var _local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
if (val >= 10){
if (j > 0){
if (gameArray[i][(j - 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = -1;
_scaleY = 1;
};
};
};
if (j < 7){
if (gameArray[i][(j + 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
};
if (i > 0){
if (gameArray[(i - 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_scaleX = 1;
_scaleY = 1;
_rota = -90;
};
};
};
if (i < 15){
if (gameArray[(i + 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_rota = 90;
_scaleX = 1;
_scaleY = -1;
};
};
};
};
j = (j + 1);
};
i = (i + 1);
};
}
public function renderPill_MP1(_arg1:Number=0):void{
gameArray_MP1[Pill_MP1.i1][Pill_MP1.j1] = (color1_MP1 + _arg1);
gameArray_MP1[Pill_MP1.i2][Pill_MP1.j2] = (color2_MP1 + _arg1);
}
public function decrease_level(_arg1:MouseEvent):void{
if (level > 0){
level--;
};
txt_level.text = String(level);
}
public function snapPill_MP2():void{
timer_MP2.stop();
moveSpeed_MP2 = 0;
gameEnabled_MP2 = false;
quickDrop_MP2 = false;
renderPill_MP2(-6);
timer2_MP2.start();
}
public function snapPill_MP1():void{
timer_MP1.stop();
moveSpeed_MP1 = 0;
gameEnabled_MP1 = false;
quickDrop_MP1 = false;
renderPill_MP1(-6);
timer2_MP1.start();
}
function frame50(){
stop();
SoundMixer.stopAll();
txt_level.text = String(level);
btn_BackToMenu.addEventListener(MouseEvent.MOUSE_DOWN, BackToMenu_CLICK, false, 0, true);
btn_TryAgain.addEventListener(MouseEvent.MOUSE_DOWN, TryAgain_CLICK, false, 0, true);
}
public function gameStart_MP(_arg1:KeyboardEvent):void{
start_message_MP1.visible = false;
start_message_MP2.visible = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, gameStart_MP);
timer_MP1.addEventListener(TimerEvent.TIMER, tick_MP1);
timer_MP2.addEventListener(TimerEvent.TIMER, tick_MP2);
timer2_MP1.addEventListener(TimerEvent.TIMER, tick2_MP1);
timer2_MP2.addEventListener(TimerEvent.TIMER, tick2_MP2);
stage.addEventListener(Event.ENTER_FRAME, enter_Frame_MP1);
stage.addEventListener(Event.ENTER_FRAME, enter_Frame_MP2);
stage.addEventListener(KeyboardEvent.KEY_DOWN, controls_MP1);
stage.addEventListener(KeyboardEvent.KEY_DOWN, controls_MP2);
stage.addEventListener(KeyboardEvent.KEY_UP, controlsUp_MP1);
stage.addEventListener(KeyboardEvent.KEY_UP, controlsUp_MP2);
}
public function checkClears():Boolean{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:int;
_local1 = 0;
_local2 = 0;
_local3 = 0;
_local4 = true;
_local5 = false;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = [];
_local10 = [];
while (_local4) {
_local4 = false;
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local11 = 0;
while (_local11 < (gameArray.length - 1)) {
_local12 = 0;
while (_local12 < gameArray[0].length) {
_local2 = _local11;
_local3 = 0;
_local1 = (gameArray[_local2][_local12] % 3);
switch (gameArray[_local2][_local12]){
case 1:
_local6++;
break;
case 2:
_local7++;
break;
case 3:
_local8++;
break;
};
_local9.push(_local2);
_local10.push(_local12);
while (((((!((gameArray[_local2][_local12] == 0))) && (((gameArray[_local2][_local12] % 3) == _local1)))) && ((_local2 < 16)))) {
_local9.push(_local2);
_local10.push(_local12);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
_local9 = [];
_local10 = [];
_local11 = 0;
while (_local11 < (gameArray.length - 1)) {
_local12 = 0;
while (_local12 < gameArray[0].length) {
_local2 = _local12;
_local3 = 0;
_local1 = (gameArray[_local11][_local2] % 3);
_local9.push(_local11);
_local10.push(_local2);
while (((((!((gameArray[_local11][_local2] == 0))) && (((gameArray[_local11][_local2] % 3) == _local1)))) && ((_local2 < 8)))) {
_local9.push(_local11);
_local10.push(_local2);
_local2++;
_local3++;
};
if (_local3 >= 4){
convertToStatic(_local9, _local10);
_local4 = true;
} else {
_local9 = [];
_local10 = [];
};
_local12++;
};
_local11++;
};
if (_local4){
_local5 = true;
};
};
if (((_local6 + _local7) + _local8) == 0){
win = true;
death();
} else {
txt_blueVirus.text = String(_local6);
if (txt_blueVirus.text.length < 2){
txt_blueVirus.text = ("0" + txt_blueVirus.text);
};
txt_greenVirus.text = String(_local7);
if (txt_greenVirus.text.length < 2){
txt_greenVirus.text = ("0" + txt_greenVirus.text);
};
txt_redVirus.text = String(_local8);
if (txt_redVirus.text.length < 2){
txt_redVirus.text = ("0" + txt_redVirus.text);
};
};
if (_local5){
gameEnabled = false;
timer.stop();
timer2.start();
scoreMultiplyer++;
};
return (_local5);
}
public function SinglePlayer_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
gotoAndStop("SETTINGS1P");
}
function frame60(){
stop();
SoundMixer.stopAll();
if (win_MP1){
txt_gameover.text = "Player 1 wins!";
txt_explanation.text = ("Player 1 " + txt_explanation.text);
} else {
txt_gameover.text = "Player 2 wins!";
txt_explanation.text = ("Player 2 " + txt_explanation.text);
};
btn_PlayAgain.addEventListener(MouseEvent.MOUSE_DOWN, PlayAgain_CLICK, false, 0, true);
btn_BackToMenu.addEventListener(MouseEvent.MOUSE_DOWN, BackToMenu_CLICK, false, 0, true);
}
public function Help_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
gotoAndStop("HELP");
}
public function btn_song2_CLICK(_arg1:MouseEvent):void{
SoundMixer.stopAll();
music = 2;
song_selector.x = btn_song2.x;
}
function frame70(){
btn_BackToMenu.addEventListener(MouseEvent.MOUSE_DOWN, BackToMenu_CLICK, false, 0, true);
}
public function initGame():void{
switch (music){
case 1:
sound_machine = new soundmachine();
addChild(sound_machine);
sound_machine.x = -100;
break;
case 2:
song = new song2();
song.play(0, 99);
break;
};
gameArray = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
ncolor1 = (9 + Math.ceil((Math.random() * 3)));
ncolor2 = (9 + Math.ceil((Math.random() * 3)));
txt_level.text = ("Level : " + level);
if (newScore > score){
score = newScore;
};
generateGameArea(level);
checkClears();
addPill();
}
function frame80(){
stop();
txt_level.text = String(level);
speed_selector.x = btn_slow.x;
song_selector.x = btn_song1.x;
btn_increase.addEventListener(MouseEvent.MOUSE_DOWN, increase_level, false, 0, true);
btn_decrease.addEventListener(MouseEvent.MOUSE_DOWN, decrease_level, false, 0, true);
btn_slow.addEventListener(MouseEvent.MOUSE_DOWN, btn_slow_CLICK, false, 0, true);
btn_medium.addEventListener(MouseEvent.MOUSE_DOWN, btn_medium_CLICK, false, 0, true);
btn_fast.addEventListener(MouseEvent.MOUSE_DOWN, btn_fast_CLICK, false, 0, true);
btn_song1.addEventListener(MouseEvent.MOUSE_DOWN, btn_song1_CLICK, false, 0, true);
btn_song2.addEventListener(MouseEvent.MOUSE_DOWN, btn_song2_CLICK, false, 0, true);
btn_song_none.addEventListener(MouseEvent.MOUSE_DOWN, btn_song_none_CLICK, false, 0, true);
btn_play.addEventListener(MouseEvent.MOUSE_DOWN, btn_play_CLICK, false, 0, true);
}
public function clearPill():void{
gameArray[Pill.i1][Pill.j1] = 0;
gameArray[Pill.i2][Pill.j2] = 0;
}
public function enter_Frame(_arg1:Event):void{
if (((((getTimer() - lastMove) > MOVE_DELTA)) && (moveSpeed))){
lastMove = getTimer();
movePill(0, moveSpeed, false);
};
if (((((getTimer() - lastDrop) > MOVE_DELTA)) && (quickDrop))){
lastDrop = getTimer();
movePill(1, 0, true);
};
}
public function preloading(_arg1:Event):void{
percentage = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
preloader.logo.gotoAndPlay(1);
this.removeEventListener(Event.ENTER_FRAME, preloading);
switchPreload();
} else {
preloader.allProgress.txtbox.text = String(Math.ceil(percentage));
preloader.allProgress.barLoad.scaleX = (percentage / 100);
};
}
public function rotatePill():void{
switch (Pill.pos){
case 1:
if ((((Pill.i1 > 0)) && ((gameArray[(Pill.i1 - 1)][Pill.j1] == 0)))){
clearPill();
Pill.i1--;
Pill.j2--;
Pill.pos = 2;
renderPill();
display();
};
break;
case 2:
if ((((Pill.j2 < 7)) && ((gameArray[Pill.i2][(Pill.j2 + 1)] == 0)))){
clearPill();
Pill.i1++;
Pill.j1++;
Pill.pos = 3;
renderPill();
display();
};
break;
case 3:
if ((((Pill.i2 > 0)) && ((gameArray[(Pill.i2 - 1)][Pill.j2] == 0)))){
clearPill();
Pill.i2--;
Pill.j1--;
Pill.pos = 4;
renderPill();
display();
};
break;
case 4:
if ((((Pill.i1 < 15)) && ((gameArray[Pill.i1][(Pill.j1 + 1)] == 0)))){
clearPill();
Pill.i2++;
Pill.j2++;
Pill.pos = 1;
renderPill();
display();
};
break;
};
}
function frame90(){
stop();
SoundMixer.stopAll();
txt_level.text = String(level);
txt_score.text = String(score);
btn_GameOn.addEventListener(MouseEvent.MOUSE_DOWN, PlayNextLevel_CLICK);
btn_BackToMenu.addEventListener(MouseEvent.MOUSE_DOWN, BackToMenu_CLICK);
}
public function increase_level(_arg1:MouseEvent):void{
if (level < 20){
level++;
};
txt_level.text = String(level);
}
public function TryAgain_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
newScore = 0;
gotoAndStop("GAME1P");
}
public function tick_MP1(_arg1:TimerEvent):void{
if (gameEnabled_MP1){
movePill_MP1(1, 0, true);
};
}
public function death_MP():void{
gameEnabled = false;
timer_MP1.stop();
timer2_MP1.stop();
timer_MP1.stop();
timer2_MP2.stop();
timer_MP1.removeEventListener(TimerEvent.TIMER, tick_MP1);
timer2_MP1.removeEventListener(TimerEvent.TIMER, tick2_MP1);
timer_MP2.removeEventListener(TimerEvent.TIMER, tick_MP2);
timer2_MP2.removeEventListener(TimerEvent.TIMER, tick_MP2);
stage.removeEventListener(Event.ENTER_FRAME, enter_Frame_MP1);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, controls_MP1);
stage.removeEventListener(Event.ENTER_FRAME, enter_Frame_MP2);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, controls_MP2);
if (music == 1){
removeChild(sound_machine);
};
BitmapTransition();
gotoAndStop("GAMEOVER2P");
}
public function rotatePill_MP1():void{
switch (Pill_MP1.pos){
case 1:
if ((((Pill_MP1.i1 > 0)) && ((gameArray_MP1[(Pill_MP1.i1 - 1)][Pill_MP1.j1] == 0)))){
clearPill_MP1();
Pill_MP1.i1--;
Pill_MP1.j2--;
Pill_MP1.pos = 2;
renderPill_MP1();
display_MP1();
};
break;
case 2:
if ((((Pill_MP1.j2 < 7)) && ((gameArray_MP1[Pill_MP1.i2][(Pill_MP1.j2 + 1)] == 0)))){
clearPill_MP1();
Pill_MP1.i1++;
Pill_MP1.j1++;
Pill_MP1.pos = 3;
renderPill_MP1();
display_MP1();
};
break;
case 3:
if ((((Pill_MP1.i2 > 0)) && ((gameArray_MP1[(Pill_MP1.i2 - 1)][Pill_MP1.j2] == 0)))){
clearPill_MP1();
Pill_MP1.i2--;
Pill_MP1.j1--;
Pill_MP1.pos = 4;
renderPill_MP1();
display_MP1();
};
break;
case 4:
if ((((Pill_MP1.i1 < 15)) && ((gameArray_MP1[Pill_MP1.i1][(Pill_MP1.j1 + 1)] == 0)))){
clearPill_MP1();
Pill_MP1.i2++;
Pill_MP1.j2++;
Pill_MP1.pos = 1;
renderPill_MP1();
display_MP1();
};
break;
};
}
public function btn_slow_CLICK(_arg1:MouseEvent):void{
speed = 900;
speed_selector.x = btn_slow.x;
}
public function btn_song_none_CLICK(_arg1:MouseEvent):void{
SoundMixer.stopAll();
music = 0;
song_selector.x = btn_song_none.x;
}
public function rotatePill_MP2():void{
switch (Pill_MP2.pos){
case 1:
if ((((Pill_MP2.i1 > 0)) && ((gameArray_MP2[(Pill_MP2.i1 - 1)][Pill_MP2.j1] == 0)))){
clearPill_MP2();
Pill_MP2.i1--;
Pill_MP2.j2--;
Pill_MP2.pos = 2;
renderPill_MP2();
display_MP2();
};
break;
case 2:
if ((((Pill_MP2.j2 < 7)) && ((gameArray_MP2[Pill_MP2.i2][(Pill_MP2.j2 + 1)] == 0)))){
clearPill_MP2();
Pill_MP2.i1++;
Pill_MP2.j1++;
Pill_MP2.pos = 3;
renderPill_MP2();
display_MP2();
};
break;
case 3:
if ((((Pill_MP2.i2 > 0)) && ((gameArray_MP2[(Pill_MP2.i2 - 1)][Pill_MP2.j2] == 0)))){
clearPill_MP2();
Pill_MP2.i2--;
Pill_MP2.j1--;
Pill_MP2.pos = 4;
renderPill_MP2();
display_MP2();
};
break;
case 4:
if ((((Pill_MP2.i1 < 15)) && ((gameArray_MP2[Pill_MP2.i1][(Pill_MP2.j1 + 1)] == 0)))){
clearPill_MP2();
Pill_MP2.i2++;
Pill_MP2.j2++;
Pill_MP2.pos = 1;
renderPill_MP2();
display_MP2();
};
break;
};
}
public function addPill():void{
if (((gameArray[0][3]) || (gameArray[0][4]))){
win = false;
death();
} else {
scoreMultiplyer = 1;
quickDrop = false;
color1 = ncolor1;
color2 = ncolor2;
ncolor1 = (9 + Math.ceil((Math.random() * 3)));
ncolor2 = (9 + Math.ceil((Math.random() * 3)));
next1.gotoAndStop((ncolor1 + 1));
next2.gotoAndStop((ncolor2 + 1));
timer.start();
gameArray[0][3] = color1;
gameArray[0][4] = color2;
Pill.i1 = 0;
Pill.i2 = 0;
Pill.j1 = 3;
Pill.j2 = 4;
Pill.pos = 1;
gameEnabled = true;
display();
};
}
public function addPill_MP2():void{
if (((gameArray_MP2[0][3]) || (gameArray_MP2[0][4]))){
win_MP2 = false;
death_MP();
} else {
quickDrop_MP2 = false;
color1_MP2 = ncolor_MP2;
color2_MP2 = ncolor2_MP2;
ncolor_MP2 = (9 + Math.ceil((Math.random() * 3)));
ncolor2_MP2 = (9 + Math.ceil((Math.random() * 3)));
next1_MP2.gotoAndStop((ncolor_MP2 + 1));
next2_MP2.gotoAndStop((ncolor2_MP2 + 1));
timer_MP2.start();
gameArray_MP2[0][3] = color1_MP2;
gameArray_MP2[0][4] = color2_MP2;
Pill_MP2.i1 = 0;
Pill_MP2.i2 = 0;
Pill_MP2.j1 = 3;
Pill_MP2.j2 = 4;
Pill_MP2.pos = 1;
gameEnabled_MP2 = true;
display_MP2();
};
}
public function btn_fast_CLICK(_arg1:MouseEvent):void{
speed = 300;
speed_selector.x = btn_fast.x;
}
public function gameStart(_arg1:KeyboardEvent):void{
start_message.visible = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, gameStart);
timer.addEventListener(TimerEvent.TIMER, tick);
timer2.addEventListener(TimerEvent.TIMER, tick2);
stage.addEventListener(Event.ENTER_FRAME, enter_Frame);
stage.addEventListener(KeyboardEvent.KEY_DOWN, controls);
stage.addEventListener(KeyboardEvent.KEY_UP, controlsUp);
}
public function tick(_arg1:TimerEvent):void{
if (gameEnabled){
movePill(1, 0, true);
};
}
public function controlsUp_MP1(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 87:
canFlip_MP1 = true;
break;
case 65:
moveSpeed_MP1 = 0;
break;
case 68:
moveSpeed_MP1 = 0;
break;
case 83:
timer_MP1.start();
quickDrop_MP1 = false;
break;
};
}
public function controlsUp_MP2(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 38:
canFlip_MP2 = true;
break;
case 37:
moveSpeed_MP2 = 0;
break;
case 39:
moveSpeed_MP2 = 0;
break;
case 40:
timer_MP2.start();
quickDrop_MP2 = false;
break;
};
}
public function go_preload(_arg1:MouseEvent):void{
preloader.play();
}
public function convertToStatic(_arg1, _arg2):void{
var _local3:MovieClip;
var _local4:Number;
var _local5:Boolean;
var _local6:Number;
var _local7:int;
var _local8:int;
_local4 = 0;
_local5 = false;
_local6 = 0;
_local7 = 1;
while (_local7 < _arg1.length) {
_local6++;
_local3 = gameArea[((("tile_" + _arg1[_local7]) + "_") + _arg2[_local7])];
_local4 = ((gameArray[_arg1[_local7]][_arg2[_local7]] % 3) + 1);
_local8 = 0;
while (_local8 < 15) {
addChild(new particle(_local4, (_local3.x + gameArea.x), (_local3.y + gameArea.y)));
_local8++;
};
if ((((gameArray[_arg1[_local7]][_arg2[_local7]] >= 1)) && ((gameArray[_arg1[_local7]][_arg2[_local7]] <= 3)))){
_local5 = true;
};
gameArray[_arg1[_local7]][_arg2[_local7]] = 0;
display();
if ((((_arg1[_local7] > 0)) && ((_local3._rota == -90)))){
if ((((gameArray[(_arg1[_local7] - 1)][_arg2[_local7]] >= 7)) && ((gameArray[(_arg1[_local7] - 1)][_arg2[_local7]] <= 9)))){
gameArray[(_arg1[_local7] - 1)][_arg2[_local7]] = (gameArray[(_arg1[_local7] - 1)][_arg2[_local7]] - 3);
};
};
if ((((_arg1[_local7] < 16)) && ((_local3._rota == 90)))){
if ((((gameArray[(_arg1[_local7] + 1)][_arg2[_local7]] >= 7)) && ((gameArray[(_arg1[_local7] + 1)][_arg2[_local7]] <= 9)))){
gameArray[(_arg1[_local7] + 1)][_arg2[_local7]] = (gameArray[(_arg1[_local7] + 1)][_arg2[_local7]] - 3);
};
};
if ((((((_arg2[_local7] > 0)) && ((_local3._rota == 0)))) && ((_local3._scaleX == -1)))){
if ((((gameArray[_arg1[_local7]][(_arg2[_local7] - 1)] >= 7)) && ((gameArray[_arg1[_local7]][(_arg2[_local7] - 1)] <= 9)))){
gameArray[_arg1[_local7]][(_arg2[_local7] - 1)] = (gameArray[_arg1[_local7]][(_arg2[_local7] - 1)] - 3);
};
};
if ((((((_arg2[_local7] < 7)) && ((_local3._rota == 0)))) && ((_local3._scaleX == 1)))){
if ((((gameArray[_arg1[_local7]][(_arg2[_local7] + 1)] >= 7)) && ((gameArray[_arg1[_local7]][(_arg2[_local7] + 1)] <= 9)))){
gameArray[_arg1[_local7]][(_arg2[_local7] + 1)] = (gameArray[_arg1[_local7]][(_arg2[_local7] + 1)] - 3);
};
};
_local7++;
};
if (_local5){
score = (score + ((_local6 * (level + 1)) * scoreMultiplyer));
};
}
public function tick_MP2(_arg1:TimerEvent):void{
if (gameEnabled_MP2){
movePill_MP2(1, 0, true);
};
}
public function btn_song1_CLICK(_arg1:MouseEvent):void{
SoundMixer.stopAll();
music = 1;
song_selector.x = btn_song1.x;
}
public function btn_medium_CLICK(_arg1:MouseEvent):void{
speed = 600;
speed_selector.x = btn_medium.x;
}
public function convertToStatic_MP2(_arg1, _arg2):void{
var _local3:MovieClip;
var _local4:Number;
var _local5:int;
var _local6:int;
_local4 = 0;
_local5 = 1;
while (_local5 < _arg1.length) {
_local3 = gameArea_MP2[((("tile_" + _arg1[_local5]) + "_") + _arg2[_local5])];
_local4 = ((gameArray_MP2[_arg1[_local5]][_arg2[_local5]] % 3) + 1);
_local6 = 0;
while (_local6 < 15) {
addChild(new particle(_local4, (_local3.x + gameArea_MP2.x), (_local3.y + gameArea_MP2.y)));
_local6++;
};
gameArray_MP2[_arg1[_local5]][_arg2[_local5]] = 0;
display_MP2();
if ((((_arg1[_local5] > 0)) && ((_local3._rota == -90)))){
if ((((gameArray_MP2[(_arg1[_local5] - 1)][_arg2[_local5]] >= 7)) && ((gameArray_MP2[(_arg1[_local5] - 1)][_arg2[_local5]] <= 9)))){
gameArray_MP2[(_arg1[_local5] - 1)][_arg2[_local5]] = (gameArray_MP2[(_arg1[_local5] - 1)][_arg2[_local5]] - 3);
};
};
if ((((_arg1[_local5] < 16)) && ((_local3._rota == 90)))){
if ((((gameArray_MP2[(_arg1[_local5] + 1)][_arg2[_local5]] >= 7)) && ((gameArray_MP2[(_arg1[_local5] + 1)][_arg2[_local5]] <= 9)))){
gameArray_MP2[(_arg1[_local5] + 1)][_arg2[_local5]] = (gameArray_MP2[(_arg1[_local5] + 1)][_arg2[_local5]] - 3);
};
};
if ((((((_arg2[_local5] > 0)) && ((_local3._rota == 0)))) && ((_local3._scaleX == -1)))){
if ((((gameArray_MP2[_arg1[_local5]][(_arg2[_local5] - 1)] >= 7)) && ((gameArray_MP2[_arg1[_local5]][(_arg2[_local5] - 1)] <= 9)))){
gameArray_MP2[_arg1[_local5]][(_arg2[_local5] - 1)] = (gameArray_MP2[_arg1[_local5]][(_arg2[_local5] - 1)] - 3);
};
};
if ((((((_arg2[_local5] < 7)) && ((_local3._rota == 0)))) && ((_local3._scaleX == 1)))){
if ((((gameArray_MP2[_arg1[_local5]][(_arg2[_local5] + 1)] >= 7)) && ((gameArray_MP2[_arg1[_local5]][(_arg2[_local5] + 1)] <= 9)))){
gameArray_MP2[_arg1[_local5]][(_arg2[_local5] + 1)] = (gameArray_MP2[_arg1[_local5]][(_arg2[_local5] + 1)] - 3);
};
};
_local5++;
};
}
public function PlayAgain_CLICK(_arg1:MouseEvent):void{
BitmapTransition();
gotoAndStop("GAME2P");
}
public function movePill_MP1(_arg1, _arg2, _arg3):void{
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
_local4 = false;
_local5 = false;
_local6 = false;
if (((((((((Pill_MP1.i1 + _arg1) > 15)) || (((Pill_MP1.i2 + _arg1) > 15)))) || (((Pill_MP1.j1 + _arg2) > 7)))) || (((Pill_MP1.j2 + _arg2) > 7)))){
_local4 = true;
};
if (((((Pill_MP1.j1 + _arg2) < 0)) || (((Pill_MP1.j2 + _arg2) < 0)))){
_local4 = true;
};
if (!_local4){
if ((((gameArray_MP1[(Pill_MP1.i1 + _arg1)][(Pill_MP1.j1 + _arg2)] == 0)) || ((gameArray_MP1[(Pill_MP1.i1 + _arg1)][(Pill_MP1.j1 + _arg2)] >= 10)))){
_local5 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
if ((((gameArray_MP1[(Pill_MP1.i2 + _arg1)][(Pill_MP1.j2 + _arg2)] == 0)) || ((gameArray_MP1[(Pill_MP1.i2 + _arg1)][(Pill_MP1.j2 + _arg2)] >= 10)))){
_local6 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
};
if (((((_local5) && (_local6))) && (!(_local4)))){
clearPill_MP1();
Pill_MP1.i1 = (Pill_MP1.i1 + _arg1);
Pill_MP1.i2 = (Pill_MP1.i2 + _arg1);
Pill_MP1.j1 = (Pill_MP1.j1 + _arg2);
Pill_MP1.j2 = (Pill_MP1.j2 + _arg2);
renderPill_MP1();
};
if (((_local4) && (_arg3))){
snapPill_MP1();
} else {
display_MP1();
};
}
public function convertToStatic_MP1(_arg1, _arg2):void{
var _local3:MovieClip;
var _local4:Number;
var _local5:int;
var _local6:int;
_local4 = 0;
_local5 = 1;
while (_local5 < _arg1.length) {
_local3 = gameArea_MP1[((("tile_" + _arg1[_local5]) + "_") + _arg2[_local5])];
_local4 = ((gameArray_MP1[_arg1[_local5]][_arg2[_local5]] % 3) + 1);
_local6 = 0;
while (_local6 < 15) {
addChild(new particle(_local4, (_local3.x + gameArea_MP1.x), (_local3.y + gameArea_MP1.y)));
_local6++;
};
gameArray_MP1[_arg1[_local5]][_arg2[_local5]] = 0;
display_MP1();
if ((((_arg1[_local5] > 0)) && ((_local3._rota == -90)))){
if ((((gameArray_MP1[(_arg1[_local5] - 1)][_arg2[_local5]] >= 7)) && ((gameArray_MP1[(_arg1[_local5] - 1)][_arg2[_local5]] <= 9)))){
gameArray_MP1[(_arg1[_local5] - 1)][_arg2[_local5]] = (gameArray_MP1[(_arg1[_local5] - 1)][_arg2[_local5]] - 3);
};
};
if ((((_arg1[_local5] < 16)) && ((_local3._rota == 90)))){
if ((((gameArray_MP1[(_arg1[_local5] + 1)][_arg2[_local5]] >= 7)) && ((gameArray_MP1[(_arg1[_local5] + 1)][_arg2[_local5]] <= 9)))){
gameArray_MP1[(_arg1[_local5] + 1)][_arg2[_local5]] = (gameArray_MP1[(_arg1[_local5] + 1)][_arg2[_local5]] - 3);
};
};
if ((((((_arg2[_local5] > 0)) && ((_local3._rota == 0)))) && ((_local3._scaleX == -1)))){
if ((((gameArray_MP1[_arg1[_local5]][(_arg2[_local5] - 1)] >= 7)) && ((gameArray_MP1[_arg1[_local5]][(_arg2[_local5] - 1)] <= 9)))){
gameArray_MP1[_arg1[_local5]][(_arg2[_local5] - 1)] = (gameArray_MP1[_arg1[_local5]][(_arg2[_local5] - 1)] - 3);
};
};
if ((((((_arg2[_local5] < 7)) && ((_local3._rota == 0)))) && ((_local3._scaleX == 1)))){
if ((((gameArray_MP1[_arg1[_local5]][(_arg2[_local5] + 1)] >= 7)) && ((gameArray_MP1[_arg1[_local5]][(_arg2[_local5] + 1)] <= 9)))){
gameArray_MP1[_arg1[_local5]][(_arg2[_local5] + 1)] = (gameArray_MP1[_arg1[_local5]][(_arg2[_local5] + 1)] - 3);
};
};
_local5++;
};
}
public function movePill_MP2(_arg1, _arg2, _arg3):void{
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
_local4 = false;
_local5 = false;
_local6 = false;
if (((((((((Pill_MP2.i1 + _arg1) > 15)) || (((Pill_MP2.i2 + _arg1) > 15)))) || (((Pill_MP2.j1 + _arg2) > 7)))) || (((Pill_MP2.j2 + _arg2) > 7)))){
_local4 = true;
};
if (((((Pill_MP2.j1 + _arg2) < 0)) || (((Pill_MP2.j2 + _arg2) < 0)))){
_local4 = true;
};
if (!_local4){
if ((((gameArray_MP2[(Pill_MP2.i1 + _arg1)][(Pill_MP2.j1 + _arg2)] == 0)) || ((gameArray_MP2[(Pill_MP2.i1 + _arg1)][(Pill_MP2.j1 + _arg2)] >= 10)))){
_local5 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
if ((((gameArray_MP2[(Pill_MP2.i2 + _arg1)][(Pill_MP2.j2 + _arg2)] == 0)) || ((gameArray_MP2[(Pill_MP2.i2 + _arg1)][(Pill_MP2.j2 + _arg2)] >= 10)))){
_local6 = true;
} else {
if (_arg2 == 0){
_arg3 = true;
_local4 = true;
};
};
};
if (((((_local5) && (_local6))) && (!(_local4)))){
clearPill_MP2();
Pill_MP2.i1 = (Pill_MP2.i1 + _arg1);
Pill_MP2.i2 = (Pill_MP2.i2 + _arg1);
Pill_MP2.j1 = (Pill_MP2.j1 + _arg2);
Pill_MP2.j2 = (Pill_MP2.j2 + _arg2);
renderPill_MP2();
};
if (((_local4) && (_arg3))){
snapPill_MP2();
} else {
display_MP2();
};
}
public function tick2_MP1(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
_local2 = true;
_local3 = false;
_local4 = false;
_local5 = 15;
while (_local5 >= 0) {
_local6 = 0;
while (_local6 < 8) {
_local3 = false;
_local4 = false;
if ((((gameArray_MP1[_local5][_local6] >= 4)) && ((gameArray_MP1[_local5][_local6] <= 6)))){
if ((((_local5 < 15)) && ((gameArray_MP1[(_local5 + 1)][_local6] == 0)))){
_local3 = true;
};
} else {
if ((((((gameArray_MP1[_local5][_local6] >= 7)) && ((gameArray_MP1[_local5][_local6] <= 9)))) && ((_local5 < 15)))){
if ((((((((((_local5 > 0)) && ((gameArray_MP1[(_local5 - 1)][_local6] >= 7)))) && ((gameArray_MP1[(_local5 - 1)][_local6] <= 9)))) && ((gameArray_MP1[(_local5 + 1)][_local6] == 0)))) && ((gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._rota == -90)))){
_local3 = true;
} else {
if ((((gameArray_MP1[(_local5 + 1)][_local6] == 0)) && ((gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._rota == 90)))){
_local3 = true;
} else {
if ((((((((gameArray_MP1[(_local5 + 1)][_local6] == 0)) && ((gameArray_MP1[(_local5 + 1)][(_local6 + 1)] == 0)))) && ((gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._scaleX == 1)))) && ((gameArea_MP1[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX == -1)))){
_local3 = true;
_local4 = true;
};
};
};
};
};
if (_local3){
_local2 = false;
gameArray_MP1[(_local5 + 1)][_local6] = gameArray_MP1[_local5][_local6];
gameArray_MP1[_local5][_local6] = 0;
gameArea_MP1[((("tile_" + (_local5 + 1)) + "_") + _local6)]._rota = gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._rota;
gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._rota = 0;
gameArea_MP1[((("tile_" + (_local5 + 1)) + "_") + _local6)]._scaleX = gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._scaleX;
gameArea_MP1[((("tile_" + _local5) + "_") + _local6)]._scaleX = 1;
if (_local4){
gameArray_MP1[(_local5 + 1)][(_local6 + 1)] = gameArray_MP1[_local5][(_local6 + 1)];
gameArray_MP1[_local5][(_local6 + 1)] = 0;
gameArea_MP1[((("tile_" + (_local5 + 1)) + "_") + (_local6 + 1))]._scaleX = gameArea_MP1[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX;
gameArea_MP1[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX = 1;
};
display_MP1();
};
_local6++;
};
_local5--;
};
if (_local2){
if (((!(checkClears_MP1())) && (((!(gameArray_MP1[0][3])) && (!(gameArray_MP1[0][4])))))){
addPill_MP1();
gameEnabled_MP1 = true;
timer2_MP1.stop();
timer_MP1.start();
};
};
}
public function controls_MP2(_arg1:KeyboardEvent):void{
if (gameEnabled_MP2){
switch (_arg1.keyCode){
case 37:
moveSpeed_MP2 = -1;
break;
case 38:
if (canFlip_MP2){
canFlip_MP2 = false;
rotatePill_MP2();
};
break;
case 39:
moveSpeed_MP2 = 1;
break;
case 40:
timer_MP2.stop();
quickDrop_MP2 = true;
break;
};
};
}
public function renderPill(_arg1:Number=0):void{
gameArray[Pill.i1][Pill.j1] = (color1 + _arg1);
gameArray[Pill.i2][Pill.j2] = (color2 + _arg1);
}
public function display_MP2():void{
var val:Number;
var ref:MovieClip;
var i:int;
var j:int;
i = 0;
while (i < (gameArray_MP2.length - 1)) {
j = 0;
while (j < gameArray_MP2[0].length) {
val = gameArray_MP2[i][j];
ref = gameArea_MP2[((("tile_" + i) + "_") + j)];
ref.gotoAndStop((val + 1));
if ((((val >= 4)) && ((val <= 6)))){
var _local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
if (val >= 10){
if (j > 0){
if (gameArray_MP2[i][(j - 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = -1;
_scaleY = 1;
};
};
};
if (j < 7){
if (gameArray_MP2[i][(j + 1)] >= 10){
_local2 = ref;
with (_local2) {
_rota = 0;
_scaleX = 1;
_scaleY = 1;
};
};
};
if (i > 0){
if (gameArray_MP2[(i - 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_scaleX = 1;
_scaleY = 1;
_rota = -90;
};
};
};
if (i < 15){
if (gameArray_MP2[(i + 1)][j] >= 10){
_local2 = ref;
with (_local2) {
_rota = 90;
_scaleX = 1;
_scaleY = -1;
};
};
};
};
j = (j + 1);
};
i = (i + 1);
};
}
public function controls_MP1(_arg1:KeyboardEvent):void{
if (gameEnabled_MP1){
switch (_arg1.keyCode){
case 65:
moveSpeed_MP1 = -1;
break;
case 87:
if (canFlip_MP1){
canFlip_MP1 = false;
rotatePill_MP1();
};
break;
case 68:
moveSpeed_MP1 = 1;
break;
case 83:
timer_MP1.stop();
quickDrop_MP1 = true;
break;
};
};
}
public function controlsUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 38:
canFlip = true;
break;
case 37:
moveSpeed = 0;
break;
case 39:
moveSpeed = 0;
break;
case 40:
timer.start();
quickDrop = false;
break;
};
}
public function tick2_MP2(_arg1:TimerEvent):void{
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
var _local6:int;
_local2 = true;
_local3 = false;
_local4 = false;
_local5 = 15;
while (_local5 >= 0) {
_local6 = 0;
while (_local6 < 8) {
_local3 = false;
_local4 = false;
if ((((gameArray_MP2[_local5][_local6] >= 4)) && ((gameArray_MP2[_local5][_local6] <= 6)))){
if ((((_local5 < 15)) && ((gameArray_MP2[(_local5 + 1)][_local6] == 0)))){
_local3 = true;
};
} else {
if ((((((gameArray_MP2[_local5][_local6] >= 7)) && ((gameArray_MP2[_local5][_local6] <= 9)))) && ((_local5 < 15)))){
if ((((((((((_local5 > 0)) && ((gameArray_MP2[(_local5 - 1)][_local6] >= 7)))) && ((gameArray_MP2[(_local5 - 1)][_local6] <= 9)))) && ((gameArray_MP2[(_local5 + 1)][_local6] == 0)))) && ((gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._rota == -90)))){
_local3 = true;
} else {
if ((((gameArray_MP2[(_local5 + 1)][_local6] == 0)) && ((gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._rota == 90)))){
_local3 = true;
} else {
if ((((((((gameArray_MP2[(_local5 + 1)][_local6] == 0)) && ((gameArray_MP2[(_local5 + 1)][(_local6 + 1)] == 0)))) && ((gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._scaleX == 1)))) && ((gameArea_MP2[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX == -1)))){
_local3 = true;
_local4 = true;
};
};
};
};
};
if (_local3){
_local2 = false;
gameArray_MP2[(_local5 + 1)][_local6] = gameArray_MP2[_local5][_local6];
gameArray_MP2[_local5][_local6] = 0;
gameArea_MP2[((("tile_" + (_local5 + 1)) + "_") + _local6)]._rota = gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._rota;
gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._rota = 0;
gameArea_MP2[((("tile_" + (_local5 + 1)) + "_") + _local6)]._scaleX = gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._scaleX;
gameArea_MP2[((("tile_" + _local5) + "_") + _local6)]._scaleX = 1;
if (_local4){
gameArray_MP2[(_local5 + 1)][(_local6 + 1)] = gameArray_MP2[_local5][(_local6 + 1)];
gameArray_MP2[_local5][(_local6 + 1)] = 0;
gameArea_MP2[((("tile_" + (_local5 + 1)) + "_") + (_local6 + 1))]._scaleX = gameArea_MP2[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX;
gameArea_MP2[((("tile_" + _local5) + "_") + (_local6 + 1))]._scaleX = 1;
};
display_MP2();
};
_local6++;
};
_local5--;
};
if (_local2){
if (((!(checkClears_MP2())) && (((!(gameArray_MP2[0][3])) && (!(gameArray_MP2[0][4])))))){
addPill_MP2();
gameEnabled_MP2 = true;
timer2_MP2.stop();
timer_MP2.start();
};
};
}
}
}//package main_fla
Section 6
//preloaderCFG_2 (main_fla.preloaderCFG_2)
package main_fla {
import flash.display.*;
public dynamic class preloaderCFG_2 extends MovieClip {
public var play_button:SimpleButton;
public var logo:MovieClip;
public var allProgress:MovieClip;
public function preloaderCFG_2(){
addFrameScript(0, frame1, 54, frame55);
}
function frame1(){
stop();
}
function frame55(){
stop();
MovieClip(root).gotoAndStop("MENU");
}
}
}//package main_fla
Section 7
//soundexport_15 (main_fla.soundexport_15)
package main_fla {
import flash.display.*;
public dynamic class soundexport_15 extends MovieClip {
public function soundexport_15(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package main_fla
Section 8
//b02 (b02)
package {
import flash.media.*;
public dynamic class b02 extends Sound {
}
}//package
Section 9
//b03 (b03)
package {
import flash.media.*;
public dynamic class b03 extends Sound {
}
}//package
Section 10
//b04 (b04)
package {
import flash.media.*;
public dynamic class b04 extends Sound {
}
}//package
Section 11
//b05 (b05)
package {
import flash.media.*;
public dynamic class b05 extends Sound {
}
}//package
Section 12
//b06 (b06)
package {
import flash.media.*;
public dynamic class b06 extends Sound {
}
}//package
Section 13
//blue_virus (blue_virus)
package {
import flash.display.*;
public dynamic class blue_virus extends MovieClip {
}
}//package
Section 14
//green_virus (green_virus)
package {
import flash.display.*;
public dynamic class green_virus extends MovieClip {
}
}//package
Section 15
//particle (particle)
package {
import flash.events.*;
import flash.utils.*;
public class particle extends particleMC {
const DONE:Number;
var xSpd:Number;// = 0
var ySpd:Number;// = 0
var time:Number;// = 0
public function particle(_arg1, _arg2, _arg3):void{
var _local4:Number;
xSpd = 0;
ySpd = 0;
time = 0;
DONE = (Math.random() * 2000);
super();
time = getTimer();
x = _arg2;
y = _arg3;
xSpd = ((Math.random() * 10) - 5);
ySpd = ((Math.random() * 10) - 5);
scaleX = (scaleY = (Math.random() + 0.4));
rotation = (Math.random() * 360);
_local4 = ((Math.random() * 8) + 3);
if (rotation > 180){
ySpd = (_local4 * Math.cos(((Math.PI / 180) * rotation)));
xSpd = (-(_local4) * Math.sin(((Math.PI / 180) * rotation)));
} else {
ySpd = (_local4 * Math.cos(((Math.PI / 180) * rotation)));
xSpd = (-(_local4) * Math.sin(((Math.PI / 180) * rotation)));
};
gotoAndStop(_arg1);
addEventListener(Event.ENTER_FRAME, update);
}
private function update(_arg1:Event):void{
x = (x + xSpd);
y = (y + ySpd);
ySpd = (ySpd + 0.3);
xSpd = (xSpd * 0.98);
if ((getTimer() - time) > DONE){
alpha = (alpha - 0.08);
};
if (x > 550){
x = 550;
xSpd = -(xSpd);
rotation = -(rotation);
};
if (x < 0){
x = 0;
xSpd = -(xSpd);
rotation = -(rotation);
};
if (y > 500){
y = 500;
ySpd = (-(ySpd) * 0.7);
rotation = -(rotation);
};
if (y < 0){
y = 0;
ySpd = -(ySpd);
rotation = -(rotation);
};
if (alpha <= 0){
removeEventListener(Event.ENTER_FRAME, update);
parent.removeChild(this);
};
}
}
}//package
Section 16
//particleMC (particleMC)
package {
import flash.display.*;
public dynamic class particleMC extends MovieClip {
}
}//package
Section 17
//red_virus (red_virus)
package {
import flash.display.*;
public dynamic class red_virus extends MovieClip {
}
}//package
Section 18
//song2 (song2)
package {
import flash.media.*;
public dynamic class song2 extends Sound {
}
}//package
Section 19
//soundmachine (soundmachine)
package {
import flash.events.*;
import flash.media.*;
import flash.display.*;
public dynamic class soundmachine extends MovieClip {
public var mtrack:Number;
public var bgChannel:SoundChannel;
public var bgLoop:Sound;
public function soundmachine(){
addFrameScript(1, frame2);
}
public function soundComplete(_arg1:Event):void{
trace("Sound complete");
if ((((mtrack == 0)) || ((mtrack == 1)))){
trace("First sound loop");
bgLoop = new b04();
bgChannel = bgLoop.play();
};
if ((((mtrack == 2)) || ((mtrack == 3)))){
trace("Second sound loop");
bgLoop = new b06();
bgChannel = bgLoop.play();
};
if ((((mtrack == 4)) || ((mtrack == 5)))){
trace("Third sound loop");
bgLoop = new b05();
bgChannel = bgLoop.play();
};
if ((((mtrack == 6)) || ((mtrack == 7)))){
trace("Fourth sound loop");
bgLoop = new b06();
bgChannel = bgLoop.play();
};
if ((((mtrack == 8)) || ((mtrack == 9)))){
trace("Fifth sound loop");
bgLoop = new b02();
bgChannel = bgLoop.play();
};
if ((((mtrack == 10)) || ((mtrack == 11)))){
trace("Sixth sound loop");
bgLoop = new b03();
bgChannel = bgLoop.play();
};
if ((((mtrack == 12)) || ((mtrack == 13)))){
trace("Seventh sound loop");
bgLoop = new b03();
bgChannel = bgLoop.play();
};
if ((((mtrack == 14)) || ((mtrack == 15)))){
trace("Eighth sound loop");
bgLoop = new b02();
bgChannel = bgLoop.play();
};
bgChannel.addEventListener(Event.SOUND_COMPLETE, soundComplete);
mtrack++;
if (mtrack > 15){
mtrack = 0;
};
}
function frame2(){
stop();
mtrack = 1;
bgLoop = new b04();
bgChannel = bgLoop.play();
bgChannel.addEventListener(Event.SOUND_COMPLETE, soundComplete);
}
}
}//package