[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Section 1 (210 B)
//png (cursor.png)
package cursor {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:int=49, _arg2:int=49){
super(_arg1, _arg2);
}
}
}//package cursor
Section 2 (225 B)
//png (cursor_bomb.png)
package cursor_bomb {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:int=49, _arg2:int=49){
super(_arg1, _arg2);
}
}
}//package cursor_bomb
Section 3 (243 B)
//png (cursor_color_bomb.png)
package cursor_color_bomb {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:int=49, _arg2:int=49){
super(_arg1, _arg2);
}
}
}//package cursor_color_bomb
Section 4 (288 B)
//AlphaObject (main.AlphaObject)
package main {
import flash.events.*;
public class AlphaObject extends CustomAlphaObject {
override protected function OnAlphaUpdate(_arg1:Event):void{
if (Game.gamePause){
return;
};
super.OnAlphaUpdate(_arg1);
}
}
}//package main
Section 5 (3.6 KiB) ●
//BasicObject (main.BasicObject)
package main {
import flash.events.*;
import flash.geom.*;
public class BasicObject extends AlphaObject {
protected var m_velocity:Vect;
private var m_startPoint:Point;
private var m_targetPoint:Point;
private var m_speed:Number;
private var m_distance:Number;// = 0
private var m_moving:Boolean;// = false
private var m_targetPoints:Array;
public static const MOVE_FINISH = "moveFinish";
public static const MOVE_START = "moveStart";
public function BasicObject(){
m_velocity = new Vect();
}
protected function updateVelocity(){
m_velocity.setMembers((m_targetPoint.x - x), (m_targetPoint.y - y));
m_velocity.mulScalar((m_speed / m_velocity.magnitude()));
}
public function moveToPoint(_arg1:Point, _arg2:int, _arg3:Number=1){
m_startPoint = null;
m_targetPoint = null;
m_startPoint = new Point(x, y);
m_targetPoint = new Point(_arg1.x, _arg1.y);
m_speed = _arg2;
m_startAlpha = alpha;
m_finishAlpha = _arg3;
updateVelocity();
m_distance = Point.distance(new Point(x, y), m_targetPoint);
addEventListener(Event.ENTER_FRAME, Update);
m_moving = true;
doOnMoveStart(m_startPoint, m_targetPoint, m_speed);
}
public function moveToPoints(_arg1:Array, _arg2:int){
if (!_arg1.length){
return;
};
m_targetPoints = new Array();
m_targetPoints = _arg1.concat();
var _local3:Point = m_targetPoints[0];
moveToPoint(_local3, _arg2);
}
protected function move():void{
if (Game.gamePause){
return;
};
x = (x + m_velocity.x);
y = (y + m_velocity.y);
}
private function doOnMoveStart(_arg1:Point, _arg2:Point, _arg3:int){
if (((m_targetPoints) && (m_targetPoints.length))){
if (_arg2.equals(m_targetPoints[0])){
dispatchEvent(new MoveEvent(BasicObject.MOVE_START, _arg1, _arg2, _arg3));
};
} else {
dispatchEvent(new MoveEvent(BasicObject.MOVE_START, _arg1, _arg2, _arg3));
};
}
private function doOnMoveFinish(_arg1:Point, _arg2:Point, _arg3:int){
var _local4:int;
if (((m_targetPoints) && (m_targetPoints.length))){
_local4 = 0;
while (_local4 < m_targetPoints.length) {
if (_arg2.equals(m_targetPoints[_local4])){
break;
};
_local4++;
};
if (_local4 == (m_targetPoints.length - 1)){
m_targetPoints.length = 0;
m_targetPoints = null;
dispatchEvent(new MoveEvent(BasicObject.MOVE_FINISH, _arg1, _arg2, _arg3));
} else {
if (_local4 < (m_targetPoints.length - 1)){
moveToPoint(m_targetPoints[(_local4 + 1)], _arg3);
} else {
throw (new Error("Ошибка при движении по маршруту"));
};
};
} else {
dispatchEvent(new MoveEvent(BasicObject.MOVE_FINISH, _arg1, _arg2, _arg3));
};
}
private function Update(_arg1:Event):void{
var _local3:Number;
var _local4:Number;
move();
updateVelocity();
var _local2:Number = Point.distance(new Point(x, y), m_targetPoint);
if ((((_local2 > m_distance)) || ((_local2 == 0)))){
removeEventListener(Event.ENTER_FRAME, Update);
x = m_targetPoint.x;
y = m_targetPoint.y;
alpha = m_finishAlpha;
m_moving = false;
doOnMoveFinish(m_startPoint, m_targetPoint, m_speed);
} else {
m_distance = _local2;
if (((((!((m_startAlpha == m_finishAlpha))) && ((m_rest_alpha == 0)))) && (!((alpha == m_finishAlpha))))){
_local3 = Point.distance(m_startPoint, m_targetPoint);
_local4 = (((m_finishAlpha - m_startAlpha) * _local2) / _local3);
alpha = (m_finishAlpha - _local4);
};
};
}
public function get moving():Boolean{
return (m_moving);
}
}
}//package main
Section 6 (139 B)
//BombaSound (main.BombaSound)
package main {
import flash.media.*;
public dynamic class BombaSound extends Sound {
}
}//package main
Section 7 (267 B)
//BombButtonFilling (main.BombButtonFilling)
package main {
import flash.text.*;
public class BombButtonFilling extends ButtonFilling {
public var m_text:TextField;
override protected function getText():TextField{
return (m_text);
}
}
}//package main
Section 8 (523 B)
//BombMovie (main.BombMovie)
package main {
import flash.display.*;
public class BombMovie extends MyButton {
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MyButton.MODE_NORMAL:
return (new BombMovieNormal());
case MyButton.MODE_OVER:
return (new BombMovieOver());
case MyButton.MODE_PRESSED:
return (new BombMoviePressed());
case MyButton.MODE_DISABLED:
return (new BombMovieDisabled());
};
return (null);
}
}
}//package main
Section 9 (166 B)
//BombMovieDisabled (main.BombMovieDisabled)
package main {
import flash.display.*;
public dynamic class BombMovieDisabled extends MovieClip {
}
}//package main
Section 10 (160 B)
//BombMovieNormal (main.BombMovieNormal)
package main {
import flash.display.*;
public dynamic class BombMovieNormal extends MovieClip {
}
}//package main
Section 11 (154 B)
//BombMovieOver (main.BombMovieOver)
package main {
import flash.display.*;
public dynamic class BombMovieOver extends MovieClip {
}
}//package main
Section 12 (163 B)
//BombMoviePressed (main.BombMoviePressed)
package main {
import flash.display.*;
public dynamic class BombMoviePressed extends MovieClip {
}
}//package main
Section 13 (151 B)
//BonusFullSound (main.BonusFullSound)
package main {
import flash.media.*;
public dynamic class BonusFullSound extends Sound {
}
}//package main
Section 14 (139 B)
//Boom1Sound (main.Boom1Sound)
package main {
import flash.media.*;
public dynamic class Boom1Sound extends Sound {
}
}//package main
Section 15 (142 B)
//Burst1Sound (main.Burst1Sound)
package main {
import flash.media.*;
public dynamic class Burst1Sound extends Sound {
}
}//package main
Section 16 (142 B)
//Burst2Sound (main.Burst2Sound)
package main {
import flash.media.*;
public dynamic class Burst2Sound extends Sound {
}
}//package main
Section 17 (142 B)
//Burst3Sound (main.Burst3Sound)
package main {
import flash.media.*;
public dynamic class Burst3Sound extends Sound {
}
}//package main
Section 18 (142 B)
//Burst4Sound (main.Burst4Sound)
package main {
import flash.media.*;
public dynamic class Burst4Sound extends Sound {
}
}//package main
Section 19 (142 B)
//Burst5Sound (main.Burst5Sound)
package main {
import flash.media.*;
public dynamic class Burst5Sound extends Sound {
}
}//package main
Section 20 (145 B)
//Button1Sound (main.Button1Sound)
package main {
import flash.media.*;
public dynamic class Button1Sound extends Sound {
}
}//package main
Section 21 (1.77 KiB) ●
//ButtonFilling (main.ButtonFilling)
package main {
import flash.media.*;
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class ButtonFilling extends MovieClip {
protected var m_percent:Number;// = 0
private var m_savePercent:Number;// = 0
private var m_fillingNumber:TextField;
public static const ON_FULL = "onButtonFull";
public static const ON_PERCENT_CHANGE = "onPercentChange";
public function ButtonFilling(){
gotoAndStop(1);
m_fillingNumber = getText();
}
protected function getText():TextField{
return (null);
}
protected function internalSetPersent(_arg1:Number){
m_percent = _arg1;
}
public function save(){
m_savePercent = m_percent;
}
public function restore(){
m_percent = m_savePercent;
}
public function set percent(_arg1:Number){
var _local7:Sound;
if (m_percent == _arg1){
return;
};
var _local2:Number = m_percent;
internalSetPersent(_arg1);
m_percent = Math.min(m_percent, GameSettings.MaxBonusFillPercent);
if (_local2 == m_percent){
return;
};
dispatchEvent(new Event(ON_PERCENT_CHANGE));
var _local3:uint = (_local2 / 100);
var _local4:uint = (m_percent / 100);
if (_local3 < _local4){
if (Game.soundOn){
_local7 = new BonusFullSound();
_local7.play();
};
dispatchEvent(new Event(ON_FULL));
};
var _local5:uint = (((m_percent - 1) % 100) + 1);
var _local6:uint = ((totalFrames * _local5) / 100);
gotoAndStop(_local6);
m_fillingNumber = getText();
if (m_fillingNumber){
_local4 = (m_percent / 100);
if (_local4 == 0){
m_fillingNumber.text = "";
} else {
m_fillingNumber.text = String(_local4);
};
};
}
public function get percent():Number{
return (m_percent);
}
}
}//package main
Section 22 (133 B)
//Chain1 (main.Chain1)
package main {
import flash.display.*;
public dynamic class Chain1 extends MovieClip {
}
}//package main
Section 23 (133 B)
//Chain2 (main.Chain2)
package main {
import flash.display.*;
public dynamic class Chain2 extends MovieClip {
}
}//package main
Section 24 (475 B)
//Chains (main.Chains)
package main {
import flash.display.*;
public class Chains extends ObjectManager {
public static const MODE_NO_CHAIN = 0;
public static const MODE_CHAIN = 1;
public static const MODE_DOUBLE_CHAIN = 2;
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MODE_CHAIN:
return (new Chain1());
case MODE_DOUBLE_CHAIN:
return (new Chain2());
};
return (null);
}
}
}//package main
Section 25 (689 B)
//Cursor (main.Cursor)
package main {
import flash.display.*;
public class Cursor extends MovieClip {
private var m_mode:int;
public static const MODE_NORMAL = 1;
public static const MODE_BOMB = 2;
public static const MODE_COLOR_BOMB = 3;
public function Cursor(){
mode = MODE_NORMAL;
}
public function get mode():int{
return (m_mode);
}
public function set mode(_arg1:int):void{
if (m_mode == _arg1){
return;
};
m_mode = _arg1;
switch (m_mode){
case MODE_NORMAL:
gotoAndStop(1);
break;
case MODE_BOMB:
gotoAndStop(2);
break;
case MODE_COLOR_BOMB:
gotoAndStop(3);
break;
};
}
}
}//package main
Section 26 (1.27 KiB) ●
//CustomAlphaObject (main.CustomAlphaObject)
package main {
import flash.events.*;
import flash.display.*;
public class CustomAlphaObject extends MovieClip {
protected var m_startAlpha:Number;
protected var m_finishAlpha:Number;
private var m_inc_alpha:Number;
protected var m_rest_alpha:Number;// = 0
public static const ON_FINISH_ALPHA_CHANGE = "OnFinishAlphaChange";
public function changeAlpha(_arg1:Number, _arg2:int){
var _local3:Number;
m_startAlpha = alpha;
m_finishAlpha = _arg1;
if (stage){
_local3 = stage.frameRate;
} else {
_local3 = GameSettings.FrameRate;
};
var _local4:int = ((_local3 * _arg2) / 1000);
m_inc_alpha = ((m_finishAlpha - alpha) / _local4);
if (m_inc_alpha == 0){
m_inc_alpha = 1E-7;
};
m_rest_alpha = Math.abs((alpha - m_finishAlpha));
addEventListener(Event.ENTER_FRAME, OnAlphaUpdate);
}
protected function OnAlphaUpdate(_arg1:Event):void{
alpha = (alpha + m_inc_alpha);
if (Math.abs((alpha - m_finishAlpha)) > m_rest_alpha){
alpha = m_finishAlpha;
m_rest_alpha = 0;
removeEventListener(Event.ENTER_FRAME, OnAlphaUpdate);
dispatchEvent(new Event(ON_FINISH_ALPHA_CHANGE));
} else {
m_rest_alpha = Math.abs((alpha - m_finishAlpha));
};
}
}
}//package main
Section 27 (3.16 KiB) ●
//Figure (main.Figure)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Figure extends BasicObject {
private var m_tremble:Boolean;
private var m_figureClip:MovieClip;// = null
private var m_tremblePoint:Point;
private var m_figureManager:FigureManager;
private var m_maxFrame:int;
public static const PULL_FINISH = "pullFinish";
public static const DESTROING_FINISH = "destroingFinish";
public function Figure(_arg1:Point, _arg2:uint, _arg3:Boolean){
m_tremblePoint = new Point();
super();
x = _arg1.x;
y = _arg1.y;
m_maxFrame = Math.min(_arg2, 7);
var _local4:uint = (Math.floor((Math.random() * m_maxFrame)) + 1);
var _local5:uint = (_arg3) ? 8 : _local4;
m_figureManager = new FigureManager(_local5);
addChild(m_figureManager);
}
public function get figureIndex():uint{
return (m_figureManager.figureIndex);
}
public function randomFrame():void{
var _local1:int;
do {
_local1 = (Math.floor((Math.random() * m_maxFrame)) + 1);
} while (_local1 == m_figureManager.figureIndex);
m_figureManager.figureIndex = _local1;
}
public function get active():Boolean{
return ((m_figureManager.mode == 2));
}
public function set active(_arg1:Boolean){
var _local2:int = (_arg1) ? FigureManager.MODE_ACTIVE : FigureManager.MODE_NORMAL;
if (m_figureManager.mode == _local2){
return;
};
m_figureManager.mode = _local2;
}
public function get tremble():Boolean{
return (m_tremble);
}
public function set tremble(_arg1):void{
if (m_tremble == _arg1){
return;
};
m_tremble = _arg1;
if (m_tremble){
startTremble();
} else {
stopTremble();
};
}
private function startTremble(){
m_tremblePoint.x = x;
m_tremblePoint.y = y;
x++;
addEventListener(Event.ENTER_FRAME, onTremble);
}
private function stopTremble(){
removeEventListener(Event.ENTER_FRAME, onTremble);
x = m_tremblePoint.x;
y = m_tremblePoint.y;
}
private function onTremble(_arg1:Event){
if (x > m_tremblePoint.x){
x = (m_tremblePoint.x - 1);
} else {
x = (m_tremblePoint.x + 1);
};
}
public function get black():Boolean{
return ((m_figureManager.figureIndex == 8));
}
public function destroy():void{
m_figureManager.mode = FigureManager.MODE_DESTROY;
m_figureManager.addEventListener(ObjectManager2.CHANGE_MODE_FINISH, onDestroingFinish);
}
private function onDestroingFinish(_arg1:Event):void{
m_figureManager.removeEventListener(ObjectManager2.CHANGE_MODE_FINISH, onDestroingFinish);
dispatchEvent(new Event(DESTROING_FINISH));
}
public function pull(_arg1:Point, _arg2:int){
moveToPoint(_arg1, _arg2);
addEventListener(BasicObject.MOVE_FINISH, OnPull);
}
private function OnPull(_arg1:MoveEvent){
removeEventListener(BasicObject.MOVE_FINISH, OnPull);
moveToPoint(_arg1.startPoint, _arg1.speed);
addEventListener(BasicObject.MOVE_FINISH, OnPullFinish);
}
private function OnPullFinish(_arg1:MoveEvent){
removeEventListener(BasicObject.MOVE_FINISH, OnPullFinish);
dispatchEvent(new MoveEvent(Figure.PULL_FINISH, _arg1.startPoint, _arg1.stopPoint, _arg1.speed));
}
}
}//package main
Section 28 (276 B)
//Figure1Active (main.Figure1Active)
package main {
import flash.display.*;
public dynamic class Figure1Active extends MovieClip {
public function Figure1Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 29 (166 B)
//Figure1Destroying (main.Figure1Destroying)
package main {
import flash.display.*;
public dynamic class Figure1Destroying extends MovieClip {
}
}//package main
Section 30 (154 B)
//Figure1Normal (main.Figure1Normal)
package main {
import flash.display.*;
public dynamic class Figure1Normal extends MovieClip {
}
}//package main
Section 31 (276 B)
//Figure2Active (main.Figure2Active)
package main {
import flash.display.*;
public dynamic class Figure2Active extends MovieClip {
public function Figure2Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 32 (166 B)
//Figure2Destroying (main.Figure2Destroying)
package main {
import flash.display.*;
public dynamic class Figure2Destroying extends MovieClip {
}
}//package main
Section 33 (154 B)
//Figure2Normal (main.Figure2Normal)
package main {
import flash.display.*;
public dynamic class Figure2Normal extends MovieClip {
}
}//package main
Section 34 (276 B)
//Figure3Active (main.Figure3Active)
package main {
import flash.display.*;
public dynamic class Figure3Active extends MovieClip {
public function Figure3Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 35 (166 B)
//Figure3Destroying (main.Figure3Destroying)
package main {
import flash.display.*;
public dynamic class Figure3Destroying extends MovieClip {
}
}//package main
Section 36 (154 B)
//Figure3Normal (main.Figure3Normal)
package main {
import flash.display.*;
public dynamic class Figure3Normal extends MovieClip {
}
}//package main
Section 37 (276 B)
//Figure4Active (main.Figure4Active)
package main {
import flash.display.*;
public dynamic class Figure4Active extends MovieClip {
public function Figure4Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 38 (166 B)
//Figure4Destroying (main.Figure4Destroying)
package main {
import flash.display.*;
public dynamic class Figure4Destroying extends MovieClip {
}
}//package main
Section 39 (154 B)
//Figure4Normal (main.Figure4Normal)
package main {
import flash.display.*;
public dynamic class Figure4Normal extends MovieClip {
}
}//package main
Section 40 (276 B)
//Figure5Active (main.Figure5Active)
package main {
import flash.display.*;
public dynamic class Figure5Active extends MovieClip {
public function Figure5Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 41 (166 B)
//Figure5Destroying (main.Figure5Destroying)
package main {
import flash.display.*;
public dynamic class Figure5Destroying extends MovieClip {
}
}//package main
Section 42 (154 B)
//Figure5Normal (main.Figure5Normal)
package main {
import flash.display.*;
public dynamic class Figure5Normal extends MovieClip {
}
}//package main
Section 43 (276 B)
//Figure6Active (main.Figure6Active)
package main {
import flash.display.*;
public dynamic class Figure6Active extends MovieClip {
public function Figure6Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 44 (166 B)
//Figure6Destroying (main.Figure6Destroying)
package main {
import flash.display.*;
public dynamic class Figure6Destroying extends MovieClip {
}
}//package main
Section 45 (154 B)
//Figure6Normal (main.Figure6Normal)
package main {
import flash.display.*;
public dynamic class Figure6Normal extends MovieClip {
}
}//package main
Section 46 (276 B)
//Figure7Active (main.Figure7Active)
package main {
import flash.display.*;
public dynamic class Figure7Active extends MovieClip {
public function Figure7Active(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 47 (166 B)
//Figure7Destroying (main.Figure7Destroying)
package main {
import flash.display.*;
public dynamic class Figure7Destroying extends MovieClip {
}
}//package main
Section 48 (154 B)
//Figure7Normal (main.Figure7Normal)
package main {
import flash.display.*;
public dynamic class Figure7Normal extends MovieClip {
}
}//package main
Section 49 (292 B)
//FigureBlackActive (main.FigureBlackActive)
package main {
import flash.display.*;
public dynamic class FigureBlackActive extends MovieClip {
public function FigureBlackActive(){
addFrameScript(19, frame20);
}
function frame20(){
this.gotoAndPlay(1);
}
}
}//package main
Section 50 (178 B)
//FigureBlackDestroying (main.FigureBlackDestroying)
package main {
import flash.display.*;
public dynamic class FigureBlackDestroying extends MovieClip {
}
}//package main
Section 51 (166 B)
//FigureBlackNormal (main.FigureBlackNormal)
package main {
import flash.display.*;
public dynamic class FigureBlackNormal extends MovieClip {
}
}//package main
Section 52 (362 B)
//FigureInfo (main.FigureInfo)
package main {
public class FigureInfo {
private var m_index:int;
private var m_mode:int;
public function FigureInfo(_arg1:int, _arg2:int){
m_index = _arg1;
m_mode = _arg2;
}
public function get index():int{
return (m_index);
}
public function get mode():int{
return (m_mode);
}
}
}//package main
Section 53 (2.28 KiB) ●
//FigureManager (main.FigureManager)
package main {
import flash.display.*;
public class FigureManager extends ObjectManager2 {
private var m_figureIndex:uint;
public static const MODE_NORMAL = 1;
public static const MODE_ACTIVE = 2;
public static const MODE_DESTROY = 3;
public function FigureManager(_arg1:uint){
m_figureIndex = _arg1;
mode = MODE_NORMAL;
}
public function get figureIndex():uint{
return (m_figureIndex);
}
public function set figureIndex(_arg1:uint){
if (m_figureIndex == _arg1){
return;
};
m_figureIndex = _arg1;
var _local2:int = mode;
mode = -1;
mode = _local2;
}
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MODE_NORMAL:
switch (m_figureIndex){
case 1:
return (new Figure1Normal());
case 2:
return (new Figure2Normal());
case 3:
return (new Figure3Normal());
case 4:
return (new Figure4Normal());
case 5:
return (new Figure5Normal());
case 6:
return (new Figure6Normal());
case 7:
return (new Figure7Normal());
case 8:
return (new FigureBlackNormal());
default:
return (null);
};
case MODE_ACTIVE:
switch (m_figureIndex){
case 1:
return (new Figure1Active());
case 2:
return (new Figure2Active());
case 3:
return (new Figure3Active());
case 4:
return (new Figure4Active());
case 5:
return (new Figure5Active());
case 6:
return (new Figure6Active());
case 7:
return (new Figure7Active());
case 8:
return (new FigureBlackActive());
default:
return (null);
};
case MODE_DESTROY:
switch (m_figureIndex){
case 1:
return (new Figure1Destroying());
case 2:
return (new Figure2Destroying());
case 3:
return (new Figure3Destroying());
case 4:
return (new Figure4Destroying());
case 5:
return (new Figure5Destroying());
case 6:
return (new Figure6Destroying());
case 7:
return (new Figure7Destroying());
case 8:
return (new FigureBlackDestroying());
default:
return (null);
};
};
return (null);
}
}
}//package main
Section 54 (1.31 KiB) ●
//FigurePlace (main.FigurePlace)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class FigurePlace extends MovieClip {
private var m_row:int;
private var m_col:int;
private var m_index:int;
private var m_figure:Figure;
private var m_chains:Chains;
public function FigurePlace(_arg1:Array, _arg2:int, _arg3:int, _arg4:Point){
m_row = _arg2;
m_col = _arg3;
x = _arg4.x;
y = _arg4.y;
_arg1[m_row][m_col] = this;
m_index = 0;
var _local5:int;
while (_local5 < m_row) {
m_index = (m_index + _arg1[_local5].length);
_local5++;
};
m_index = (m_index + _arg3);
}
public function get mode():int{
if (m_chains){
return (m_chains.mode);
};
return (Chains.MODE_NO_CHAIN);
}
public function set mode(_arg1:int):void{
if (mode == _arg1){
return;
};
if (!m_chains){
m_chains = new Chains();
addChild(m_chains);
};
m_chains.mode = _arg1;
}
public function get figure(){
return (m_figure);
}
public function set figure(_arg1){
m_figure = _arg1;
}
public function get row(){
return (m_row);
}
public function get col(){
return (m_col);
}
public function get index(){
return (m_index);
}
public function get point():Point{
return (new Point(x, y));
}
}
}//package main
Section 55 (1.25 KiB) ●
//FlyingNumber (main.FlyingNumber)
package main {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
public class FlyingNumber extends BasicObject {
public var m_text:TextField;
private var m_i:int;// = 0
public function FlyingNumber(_arg1:DisplayObjectContainer, _arg2:String, _arg3:Point, _arg4:Point, _arg5:Number){
m_text.text = _arg2;
m_text.selectable = false;
m_text.embedFonts = true;
x = _arg3.x;
y = _arg3.y;
if (_arg1){
_arg1.addChild(this);
};
addEventListener(MouseEvent.CLICK, OnMouseClick);
addEventListener(BasicObject.MOVE_FINISH, onMoveFinish);
moveToPoint(_arg4, _arg5);
var _local6:Timer = new Timer(GameSettings.FLYING_NUMBER_FLY, 1);
_local6.addEventListener(TimerEvent.TIMER, onMoveTimer);
_local6.start();
}
private function OnMouseClick(_arg1:Event){
trace(("click" + m_i++));
}
private function onMoveTimer(_arg1:Event){
changeAlpha(0, GameSettings.FLYING_NUMBER_ALPHA);
}
override protected function move():void{
super.move();
}
private function onMoveFinish(_arg1:Event){
removeEventListener(BasicObject.MOVE_FINISH, onMoveFinish);
if (parent){
parent.removeChild(this);
};
}
}
}//package main
Section 56 (40.55 KiB) ● ● ● ●
//Game (main.Game)
package main {
import flash.media.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class Game extends MovieClip {
public var m_musicOffBtn:SimpleButton;
public var m_soundOffBtn:SimpleButton;
public var m_bombButtonFilling:BombButtonFilling;
public var m_shuffleButton:ShuffleButton;
public var m_moreGamesBtn:SimpleButton;
public var m_levelNumberText:TextField;
public var bg:MovieClip;
public var m_lightningButtonFilling:BombButtonFilling;
public var m_bombButton:BombMovie;
public var m_musicOnBtn:SimpleButton;
public var m_soundOnBtn:SimpleButton;
public var m_lightningButton:LightningButton;
public var m_menuButton:SimpleButton;
public var m_gameScoreText:TextField;
public var m_shuffleButtonFilling:ShuffleButtonFilling;
public var m_levelTimer:MovieClip;
private var m_level_info_array:Array;
private var m_level:PlayingField;
private var m_timer:Timer;
private var m_blinkTimer:Timer;
private var m_lightningTimer:Timer;
private var m_lightningPoints:Array;
private var m_timerSound:Sound;
private var m_timerSoundChannel:SoundChannel;
private var m_cursor:Cursor;
private var m_musicPlayer:MusicPlayer;
private var m_timeScore:uint;
private var m_tooltipWindow:TooltipWindow;
private var m_tooltipWindowTimer:Timer;
private var m_timer_tooltip_show:Boolean;// = false
private var m_match4_tooltip_show:Boolean;// = false
private var m_match5_tooltip_show:Boolean;// = false
private var m_bomb_tooltip_show:Boolean;// = false
private var m_onBlackFigureAppearShow:Boolean;// = false
private var m_onTriangleLockAppearShow:Boolean;// = false
private var m_onTriangleDoubleLockAppearShow:Boolean;// = false
private var m_onTriangleColorLockAppearShow:Boolean;// = false
private var m_onFigureChainAppearShow:Boolean;// = false
private var m_onFigureDoubleChainAppearShow:Boolean;// = false
private var m_lightning_tooltip_show:Boolean;// = false
private var m_tooltipEvents:Array;
private var m_menuBackgroundWindow:MenuBackgroundWindow;
public static var GAME_END = "gameEnd";
private static var m_gamePause:Boolean = false;
private static var m_soundOn:Boolean = true;
private static var m_musicOn:Boolean = true;
private static var m_gameScore:uint;
private static var m_RealGameScore:uint = 0;
public function Game(_arg1:Cursor){
m_tooltipEvents = new Array();
super();
m_cursor = _arg1;
m_levelTimer.gotoAndStop(1);
m_level_info_array = new Array(new LevelInfo([[0, 0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 0, 1, 1, 1, 0], [0, 0, 1, 0, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 0, 1, 0, 0], [0, 1, 1, 1, 0, 0, 0, 0], [0, 1, 1, 1, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0]], [], 180, 0, 5, 1), new LevelInfo([[0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 2, 2, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 1, 0, 0], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 2, 2, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0]], [], 180, 0, 5, 2), new LevelInfo([[0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 2, 1, 1, 1, 1, 2, 0]], [], 180, 0, 5, 3), new LevelInfo([[0, 2, 2, 0, 0, 2, 2, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 2, 0, 0, 2, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [1, 1, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0]], [new FigureInfo(28, Chains.MODE_CHAIN), new FigureInfo(30, Chains.MODE_CHAIN)], 180, 0, 5, 3), new LevelInfo([[2, 1, 1, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1, 1, 1, 2], [2, 0, 0, 1, 1, 0, 0, 2], [0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 2, 2, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 1, 1, 0, 0, 0]], [new FigureInfo(10, Chains.MODE_CHAIN), new FigureInfo(12, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[0, 0, 0, 2, 2, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 0, 0, 0, 0, 0, 0, 2], [1, 0, 0, 0, 0, 0, 0, 1], [2, 0, 0, 0, 0, 0, 0, 2], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 2, 2, 0, 0, 0]], [new FigureInfo(23, Chains.MODE_CHAIN), new FigureInfo(26, Chains.MODE_CHAIN), new FigureInfo(32, Chains.MODE_CHAIN), new FigureInfo(35, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[0, 0, 0, 4, 4, 0, 0, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 2, 1, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 1, 2, 2, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 4, 4, 0, 0, 0]], [new FigureInfo(19, Chains.MODE_CHAIN), new FigureInfo(21, Chains.MODE_CHAIN), new FigureInfo(37, Chains.MODE_CHAIN), new FigureInfo(38, Chains.MODE_CHAIN), new FigureInfo(39, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[0, 1, 1, 1, 1, 1, 1, 0], [1, 1, 4, 1, 1, 4, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1], [0, 1, 0, 2, 2, 0, 1, 0], [0, 2, 1, 4, 4, 1, 2, 0], [0, 1, 0, 2, 2, 0, 1, 0], [1, 1, 0, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 4, 1, 1, 4, 1, 1], [0, 1, 1, 1, 1, 1, 1, 0]], [new FigureInfo(11, Chains.MODE_CHAIN), new FigureInfo(28, Chains.MODE_CHAIN), new FigureInfo(30, Chains.MODE_CHAIN), new FigureInfo(38, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[4, 0, 0, 0, 0, 0, 0, 4], [4, 0, 0, 0, 0, 0, 0, 4], [4, 0, 0, 0, 0, 0, 0, 4], [2, 2, 0, 0, 0, 0, 2, 2], [1, 1, 0, 0, 0, 0, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 4, 4, 1, 1, 0], [0, 0, 2, 2, 2, 2, 0, 0], [0, 4, 1, 1, 1, 1, 4, 0]], [new FigureInfo(9, Chains.MODE_CHAIN), new FigureInfo(13, Chains.MODE_CHAIN), new FigureInfo(23, Chains.MODE_CHAIN), new FigureInfo(26, Chains.MODE_CHAIN), new FigureInfo(47, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[2, 0, 0, 0, 0, 0, 0, 2], [2, 2, 0, 0, 0, 0, 2, 2], [1, 1, 1, 0, 0, 1, 1, 1], [2, 2, 1, 4, 4, 1, 2, 2], [1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 0, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [2, 2, 1, 1, 1, 1, 2, 2], [0, 0, 0, 4, 4, 0, 0, 0], [0, 0, 0, 2, 2, 0, 0, 0], [0, 0, 0, 4, 4, 0, 0, 0]], [new FigureInfo(14, Chains.MODE_CHAIN), new FigureInfo(17, Chains.MODE_CHAIN), new FigureInfo(20, Chains.MODE_CHAIN), new FigureInfo(38, Chains.MODE_CHAIN), new FigureInfo(47, Chains.MODE_CHAIN)], 240, 0, 6, 3), new LevelInfo([[0, 4, 2, 2, 2, 2, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [4, 1, 1, 1, 1, 1, 1, 4], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 2, 2, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [4, 1, 1, 1, 1, 1, 1, 4], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 4, 2, 2, 2, 2, 4, 0]], [new FigureInfo(10, Chains.MODE_CHAIN), new FigureInfo(11, Chains.MODE_CHAIN), new FigureInfo(12, Chains.MODE_CHAIN), new FigureInfo(46, Chains.MODE_CHAIN), new FigureInfo(47, Chains.MODE_CHAIN), new FigureInfo(48, Chains.MODE_CHAIN)], 240, 5, 6, 3), new LevelInfo([[0, 4, 4, 0, 0, 4, 4, 0], [1, 1, 1, 0, 0, 1, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [1, 1, 4, 0, 0, 4, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [1, 1, 0, 0, 0, 0, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [1, 1, 4, 0, 0, 4, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [1, 1, 1, 0, 0, 1, 1, 1], [0, 4, 4, 0, 0, 4, 4, 0]], [new FigureInfo(10, Chains.MODE_CHAIN), new FigureInfo(12, Chains.MODE_CHAIN), new FigureInfo(14, Chains.MODE_CHAIN), new FigureInfo(17, Chains.MODE_CHAIN), new FigureInfo(41, Chains.MODE_CHAIN), new FigureInfo(44, Chains.MODE_CHAIN), new FigureInfo(46, Chains.MODE_CHAIN), new FigureInfo(48, Chains.MODE_CHAIN)], 240, 8, 6, 3), new LevelInfo([[0, 2, 2, 0, 0, 2, 2, 0], [1, 1, 1, 1, 1, 1, 1, 1], [4, 2, 2, 1, 1, 2, 2, 4], [1, 1, 1, 1, 1, 1, 1, 1], [4, 0, 0, 4, 4, 0, 0, 4], [0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 4, 4, 0, 0, 4], [1, 1, 1, 1, 1, 1, 1, 1], [4, 2, 2, 1, 1, 2, 2, 4], [1, 1, 1, 1, 1, 1, 1, 1], [0, 2, 2, 0, 0, 2, 2, 0]], [new FigureInfo(27, Chains.MODE_CHAIN), new FigureInfo(29, Chains.MODE_CHAIN), new FigureInfo(31, Chains.MODE_CHAIN)], 240, 10, 6, 3), new LevelInfo([[0, 4, 4, 2, 2, 4, 4, 0], [0, 4, 1, 1, 1, 1, 4, 0], [0, 1, 1, 1, 1, 1, 1, 0], [2, 1, 0, 0, 0, 0, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 2, 2, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 0, 0, 0, 0, 1, 2], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 2, 2, 4, 4, 2, 2, 0]], [new FigureInfo(11, Chains.MODE_CHAIN), new FigureInfo(20, Chains.MODE_CHAIN), new FigureInfo(29, Chains.MODE_CHAIN), new FigureInfo(46, Chains.MODE_CHAIN), new FigureInfo(48, Chains.MODE_CHAIN)], 240, 10, 6, 3), new LevelInfo([[3, 0, 0, 3, 3, 0, 0, 3], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 4, 4, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1], [3, 0, 0, 3, 3, 0, 0, 3], [0, 0, 0, 0, 0, 0, 0, 0], [3, 0, 0, 3, 3, 0, 0, 3], [1, 1, 1, 1, 1, 1, 1, 1], [2, 1, 1, 4, 4, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 1], [3, 0, 0, 3, 3, 0, 0, 3]], [new FigureInfo(14, Chains.MODE_CHAIN), new FigureInfo(17, Chains.MODE_CHAIN), new FigureInfo(27, Chains.MODE_CHAIN), new FigureInfo(29, Chains.MODE_CHAIN), new FigureInfo(31, Chains.MODE_CHAIN), new FigureInfo(41, Chains.MODE_CHAIN), new FigureInfo(44, Chains.MODE_CHAIN)], 300, 10, 6, 3), new LevelInfo([[4, 0, 3, 1, 1, 3, 0, 4], [4, 0, 1, 1, 1, 1, 0, 4], [4, 0, 0, 1, 1, 0, 0, 4], [3, 3, 0, 3, 3, 0, 3, 3], [1, 1, 0, 4, 4, 0, 1, 1], [1, 1, 0, 3, 3, 0, 1, 1], [3, 3, 0, 4, 4, 0, 3, 3], [1, 1, 0, 0, 0, 0, 1, 1], [1, 1, 4, 0, 0, 4, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1], [1, 3, 3, 0, 0, 3, 3, 1]], [new FigureInfo(29, Chains.MODE_CHAIN), new FigureInfo(46, Chains.MODE_CHAIN), new FigureInfo(48, Chains.MODE_CHAIN)], 300, 11, 6, 3), new LevelInfo([[0, 2, 3, 0, 0, 3, 2, 0], [1, 1, 1, 0, 0, 1, 1, 1], [2, 1, 1, 0, 0, 1, 1, 2], [3, 2, 1, 2, 2, 1, 2, 3], [2, 1, 4, 1, 1, 4, 1, 2], [1, 1, 3, 4, 4, 3, 1, 1], [0, 0, 0, 3, 3, 0, 0, 0], [4, 4, 0, 0, 0, 0, 4, 4], [2, 2, 0, 3, 3, 0, 2, 2], [4, 4, 0, 3, 3, 0, 4, 4], [0, 0, 0, 3, 3, 0, 0, 0]], [new FigureInfo(29, Chains.MODE_CHAIN), new FigureInfo(32, Chains.MODE_CHAIN), new FigureInfo(35, Chains.MODE_CHAIN), new FigureInfo(38, Chains.MODE_CHAIN)], 300, 11, 6, 3), new LevelInfo([[0, 0, 0, 2, 2, 2, 2, 4], [0, 0, 1, 1, 1, 1, 1, 1], [0, 1, 2, 4, 4, 2, 1, 4], [1, 1, 0, 0, 0, 0, 1, 1], [4, 1, 3, 3, 3, 3, 1, 4], [1, 1, 0, 0, 0, 0, 1, 1], [4, 1, 3, 3, 3, 3, 1, 4], [1, 1, 0, 0, 0, 0, 1, 1], [4, 1, 2, 4, 4, 2, 1, 0], [1, 1, 1, 1, 1, 1, 0, 0], [4, 2, 2, 2, 2, 0, 0, 0]], [new FigureInfo(15, Chains.MODE_CHAIN), new FigureInfo(16, Chains.MODE_CHAIN), new FigureInfo(24, Chains.MODE_CHAIN), new FigureInfo(25, Chains.MODE_CHAIN), new FigureInfo(33, Chains.MODE_CHAIN), new FigureInfo(34, Chains.MODE_CHAIN), new FigureInfo(42, Chains.MODE_CHAIN), new FigureInfo(43, Chains.MODE_CHAIN)], 300, 11, 6, 3), new LevelInfo([[0, 1, 1, 3, 3, 1, 1, 0], [4, 4, 2, 3, 3, 2, 4, 4], [4, 1, 1, 3, 3, 1, 1, 4], [0, 0, 0, 0, 0, 0, 0, 0], [1, 3, 2, 4, 4, 2, 3, 1], [1, 2, 3, 4, 4, 3, 2, 1], [1, 3, 2, 4, 4, 2, 3, 1], [1, 1, 1, 1, 1, 1, 1, 1], [1, 2, 1, 0, 0, 1, 2, 1], [1, 1, 1, 3, 3, 1, 1, 1], [3, 0, 0, 0, 0, 0, 0, 3]], [new FigureInfo(18, Chains.MODE_CHAIN), new FigureInfo(19, Chains.MODE_CHAIN), new FigureInfo(20, Chains.MODE_CHAIN), new FigureInfo(21, Chains.MODE_CHAIN), new FigureInfo(22, Chains.MODE_CHAIN), new FigureInfo(47, Chains.MODE_CHAIN)], 300, 12, 6, 3), new LevelInfo([[4, 1, 1, 3, 3, 1, 1, 4], [0, 0, 1, 1, 1, 1, 0, 0], [3, 4, 1, 3, 3, 1, 4, 3], [0, 0, 3, 3, 3, 3, 0, 0], [0, 1, 3, 0, 0, 3, 1, 0], [4, 4, 3, 0, 0, 3, 4, 4], [0, 1, 3, 0, 0, 3, 1, 0], [0, 0, 3, 3, 3, 3, 0, 0], [3, 4, 1, 3, 3, 1, 4, 3], [0, 0, 1, 1, 1, 1, 0, 0], [4, 1, 1, 3, 3, 1, 1, 4]], [new FigureInfo(5, Chains.MODE_CHAIN), new FigureInfo(8, Chains.MODE_CHAIN), new FigureInfo(14, Chains.MODE_CHAIN), new FigureInfo(17, Chains.MODE_CHAIN), new FigureInfo(41, Chains.MODE_CHAIN), new FigureInfo(44, Chains.MODE_CHAIN), new FigureInfo(50, Chains.MODE_CHAIN), new FigureInfo(53, Chains.MODE_CHAIN)], 300, 12, 6, 3));
var _local2:HelpTooltipWindow = new HelpTooltipWindow(new Point((bg.width / 2), (bg.height / 2)));
_local2.addEventListener(MyWindow.ON_CLOSE, OnCloseHelpTooltipWindow);
addChild(_local2);
if (Game.soundOn){
new HintSound().play();
};
m_shuffleButton.addEventListener(MyButton.BUTTON_CLICK, onShuffleButtonClick);
m_shuffleButton.addEventListener(MyButton.DISABLED_BUTTON_CLICK, onDisabledButtonClick);
m_shuffleButtonFilling.addEventListener(ButtonFilling.ON_FULL, onShuffleButtonFull);
m_shuffleButtonFilling.addEventListener(ButtonFilling.ON_PERCENT_CHANGE, onShuffleButtonUpdate);
m_shuffleButton.mode = MyButton.MODE_DISABLED;
m_bombButton.addEventListener(MyButton.BUTTON_CLICK, onBombButtonClick);
m_bombButton.addEventListener(MyButton.DISABLED_BUTTON_CLICK, onDisabledButtonClick);
m_bombButtonFilling.addEventListener(ButtonFilling.ON_FULL, onBombButtonFull);
m_bombButtonFilling.addEventListener(ButtonFilling.ON_PERCENT_CHANGE, onBombButtonUpdate);
m_bombButton.mode = MyButton.MODE_DISABLED;
m_lightningButton.addEventListener(MyButton.BUTTON_CLICK, onLightningButtonClick);
m_lightningButton.addEventListener(MyButton.DISABLED_BUTTON_CLICK, onDisabledButtonClick);
m_lightningButtonFilling.addEventListener(ButtonFilling.ON_FULL, onLightningButtonFull);
m_lightningButtonFilling.addEventListener(ButtonFilling.ON_PERCENT_CHANGE, onLightningButtonUpdate);
m_lightningButton.mode = MyButton.MODE_DISABLED;
m_menuButton.addEventListener(MouseEvent.CLICK, onMenuButtonClick);
m_moreGamesBtn.addEventListener(MouseEvent.CLICK, onMoreGamesBtnClick);
m_musicOnBtn.x = m_musicOffBtn.x;
m_musicOnBtn.y = m_musicOffBtn.y;
m_musicOnBtn.visible = false;
m_musicOnBtn.addEventListener(MouseEvent.MOUSE_DOWN, onMusicOnBtnClick);
m_soundOnBtn.x = m_soundOffBtn.x;
m_soundOnBtn.y = m_soundOffBtn.y;
m_soundOnBtn.visible = false;
m_soundOnBtn.addEventListener(MouseEvent.MOUSE_DOWN, onSoundOnBtnClick);
m_musicOffBtn.addEventListener(MouseEvent.MOUSE_DOWN, onMusicOffBtnClick);
m_soundOffBtn.addEventListener(MouseEvent.MOUSE_DOWN, onSoundOffBtnClick);
if (!m_musicOn){
onMusicOffBtnClick(null);
};
if (!m_soundOn){
onSoundOffBtnClick(null);
};
setButtonEnabled(false);
}
private function setButtonEnabled(_arg1:Boolean){
m_menuButton.enabled = _arg1;
m_moreGamesBtn.enabled = _arg1;
m_musicOnBtn.enabled = _arg1;
m_soundOnBtn.enabled = _arg1;
m_musicOffBtn.enabled = _arg1;
m_soundOffBtn.enabled = _arg1;
if (!_arg1){
m_lightningButton.mode = MyButton.MODE_DISABLED;
m_shuffleButton.mode = MyButton.MODE_DISABLED;
m_bombButton.mode = MyButton.MODE_DISABLED;
} else {
onLightningButtonUpdate(null);
onShuffleButtonUpdate(null);
onBombButtonUpdate(null);
};
}
private function onShuffleButtonUpdate(_arg1:Event){
if (m_shuffleButtonFilling.percent >= 100){
m_shuffleButton.mode = MyButton.MODE_NORMAL;
} else {
m_shuffleButton.mode = MyButton.MODE_DISABLED;
};
}
private function onBombButtonUpdate(_arg1:Event){
if (m_bombButtonFilling.percent >= 100){
m_bombButton.mode = MyButton.MODE_NORMAL;
} else {
m_bombButton.mode = MyButton.MODE_DISABLED;
};
}
private function onLightningButtonUpdate(_arg1:Event){
if (m_lightningButtonFilling.percent >= 100){
m_lightningButton.mode = MyButton.MODE_NORMAL;
} else {
m_lightningButton.mode = MyButton.MODE_DISABLED;
};
}
private function onMoreGamesBtnClick(_arg1:Event){
var e = _arg1;
if (!m_moreGamesBtn.enabled){
return;
};
new SoundPlayer(new Button1Sound());
var url:String = GameSettings.MORE_GAME_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function keyDownHandler(_arg1:KeyboardEvent){
}
private function onMusicOffBtnClick(_arg1:Event){
if (!m_musicOffBtn.enabled){
return;
};
m_musicOnBtn.visible = true;
m_musicOffBtn.visible = false;
musicOn = false;
}
private function onSoundOffBtnClick(_arg1:Event){
if (!m_soundOffBtn.enabled){
return;
};
m_soundOnBtn.visible = true;
m_soundOffBtn.visible = false;
soundOn = false;
}
private function onMusicOnBtnClick(_arg1:Event){
if (!m_musicOnBtn.enabled){
return;
};
m_musicOnBtn.visible = false;
m_musicOffBtn.visible = true;
musicOn = true;
}
private function onSoundOnBtnClick(_arg1:Event){
if (!m_soundOnBtn.enabled){
return;
};
m_soundOnBtn.visible = false;
m_soundOffBtn.visible = true;
soundOn = true;
}
private function onShuffleButtonFull(_arg1:Event){
m_shuffleButtonFilling.removeEventListener(ButtonFilling.ON_FULL, onShuffleButtonFull);
showTooltipWindow(GameSettings.SHUFFLE_TOOLTIP, globalToLocal(new Point(m_shuffleButton.x, m_shuffleButton.y)));
}
private function onBombButtonFull(_arg1:Event){
m_bombButtonFilling.removeEventListener(ButtonFilling.ON_FULL, onBombButtonFull);
showTooltipWindow(GameSettings.BOMB_FULL_TOOLTIP, globalToLocal(new Point(m_bombButton.x, m_bombButton.y)));
}
private function onLightningButtonFull(_arg1:Event){
m_lightningButtonFilling.removeEventListener(ButtonFilling.ON_FULL, onLightningButtonFull);
showTooltipWindow(GameSettings.LIGHTNING_FULL_TOOLTIP, globalToLocal(new Point(m_lightningButton.x, m_lightningButton.y)));
}
private function endGame(){
freeLevel();
dispatchEvent(new Event(GAME_END));
}
private function onDisabledButtonClick(_arg1:Event){
if (Game.soundOn){
new NoSound().play();
};
}
private function OnCloseHelpTooltipWindow(_arg1:Event){
var _local2:HelpTooltipWindow = HelpTooltipWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, OnCloseHelpTooltipWindow);
removeChild(_local2);
setButtonEnabled(true);
loadLevel(1);
}
private function onBlackFigureAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_BLACK_FIGURE_APPEAR, onBlackFigureAppear);
if (m_onBlackFigureAppearShow){
return;
};
m_onBlackFigureAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.BLACK_FIGURE_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.BLACK_FIGURE_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function onTriangleLockAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_TRIANGLE_LOCK_APPEAR, onTriangleLockAppear);
if (m_onTriangleLockAppearShow){
return;
};
m_onTriangleLockAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.LOCK_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.LOCK_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function onTriangleDoubleLockAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_TRIANGLE_DOUBLE_LOCK_APPEAR, onTriangleDoubleLockAppear);
if (m_onTriangleDoubleLockAppearShow){
return;
};
m_onTriangleDoubleLockAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.DOUBLE_LOCK_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.DOUBLE_LOCK_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function onTriangleColorLockAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_TRIANGLE_COLOR_LOCK_APPEAR, onTriangleColorLockAppear);
if (m_onTriangleColorLockAppearShow){
return;
};
m_onTriangleColorLockAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.COLOR_LOCK_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.COLOR_LOCK_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function onFigureChainAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_FIGURE_CHAIN_APPEAR, onFigureChainAppear);
if (m_onFigureChainAppearShow){
return;
};
m_onFigureChainAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.CHAIN_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.CHAIN_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function onFigureDoubleChainAppear(_arg1:TooltipEvent):void{
m_level.removeEventListener(PlayingField.ON_FIGURE_DOUBLE_CHAIN_APPEAR, onFigureDoubleChainAppear);
if (m_onFigureDoubleChainAppearShow){
return;
};
m_onFigureDoubleChainAppearShow = true;
if (m_level.getMode() == PlayingField.MODE_LOADING){
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.DOUBLE_CHAIN_TOOLTIP, globalToLocal(_arg1.point)));
} else {
showTooltipWindow(GameSettings.DOUBLE_CHAIN_TOOLTIP, globalToLocal(_arg1.point));
};
}
private function addBackgroundWindow(){
if (!m_menuBackgroundWindow){
m_menuBackgroundWindow = new MenuBackgroundWindow(new Point((bg.width / 2), (bg.height / 2)));
m_menuBackgroundWindow.alpha = GameSettings.BACKGROUND_WINDOW_ALPHA;
};
if (!contains(m_menuBackgroundWindow)){
addChild(m_menuBackgroundWindow);
};
}
private function removeBackgroundWindow(){
if (!m_menuBackgroundWindow){
return;
};
if (contains(m_menuBackgroundWindow)){
removeChild(m_menuBackgroundWindow);
};
m_menuBackgroundWindow = null;
}
private function onMenuButtonClick(_arg1:Event):void{
if (!m_menuButton.enabled){
return;
};
if (gamePause){
return;
};
if (Game.soundOn){
new Button1Sound().play();
};
addBackgroundWindow();
var _local2:GameMenuWindow = new GameMenuWindow(new Point((bg.width / 2), (bg.height / 2)));
_local2.addEventListener(MyWindow.ON_CLOSE, onMenuWindowClose);
addChild(_local2);
gamePause = true;
}
private function onMenuWindowClose(_arg1:Event):void{
var _local2:GameMenuWindow = GameMenuWindow(_arg1.target);
if (contains(_local2)){
removeChild(_local2);
removeBackgroundWindow();
gamePause = false;
switch (_local2.action){
case GameMenuWindow.ACTION_RESTART_LEVEL:
m_shuffleButtonFilling.restore();
m_bombButtonFilling.restore();
m_lightningButtonFilling.restore();
loadLevel(m_level.levelNumber);
break;
case GameMenuWindow.ACTION_ABORT_GAME:
endGame();
break;
};
};
}
private function freeLevel(){
if (stage){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
m_tooltipEvents.length = 0;
if (m_musicPlayer){
m_musicPlayer.stop(0, null);
m_musicPlayer = null;
};
if (m_timer){
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, onLevelTimer);
m_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onLevelTimerComplete);
m_timer = null;
};
if (m_blinkTimer){
m_blinkTimer.removeEventListener(TimerEvent.TIMER, onBlinkTimer);
m_blinkTimer = null;
};
if (m_level){
m_level.removeEventListener(PlayingField.ON_BOMB_USE, onBombFinish);
m_level.removeEventListener(PlayingField.LOAD_COMPLETE, onLevelLoadComplete);
m_level.removeEventListener(PlayingField.LEVEL_COMPLETE, onLevelComplete);
m_level.removeEventListener(PlayingField.ON_SCORE_CHANGE, onLevelScoreChange);
m_level.removeEventListener(PlayingField.ON_BLACK_FIGURE_APPEAR, onBlackFigureAppear);
m_level.removeEventListener(PlayingField.ON_TRIANGLE_LOCK_APPEAR, onTriangleLockAppear);
m_level.removeEventListener(PlayingField.ON_TRIANGLE_DOUBLE_LOCK_APPEAR, onTriangleDoubleLockAppear);
m_level.removeEventListener(PlayingField.ON_TRIANGLE_COLOR_LOCK_APPEAR, onTriangleColorLockAppear);
m_level.removeEventListener(PlayingField.ON_FIGURE_CHAIN_APPEAR, onFigureChainAppear);
m_level.removeEventListener(PlayingField.ON_FIGURE_DOUBLE_CHAIN_APPEAR, onFigureDoubleChainAppear);
removeChild(m_level);
m_level = null;
};
m_levelTimer.gotoAndStop(1);
m_levelTimer.visible = true;
}
private function loadLevel(_arg1:int){
freeLevel();
m_shuffleButtonFilling.percent = 0;
m_levelTimer.gotoAndStop(1);
m_levelTimer.visible = true;
m_levelNumberText.text = String(_arg1);
m_gameScoreText.text = String(m_gameScore);
m_RealGameScore = m_gameScore;
var _local2:LevelInfo = m_level_info_array[(_arg1 - 1)];
m_timer = new Timer(1000, _local2.time);
m_timer.addEventListener(TimerEvent.TIMER, onLevelTimer);
m_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onLevelTimerComplete);
m_blinkTimer = new Timer(500);
m_blinkTimer.addEventListener(TimerEvent.TIMER, onBlinkTimer);
m_level = new PlayingField(_local2, _arg1);
m_level.x = 63;
m_level.y = 63;
addChild(m_level);
m_level.addEventListener(PlayingField.LOAD_COMPLETE, onLevelLoadComplete);
m_level.addEventListener(PlayingField.LEVEL_COMPLETE, onLevelComplete);
m_level.addEventListener(PlayingField.ON_SCORE_CHANGE, onLevelScoreChange);
m_shuffleButtonFilling.visible = (_local2.bonus >= 1);
m_bombButtonFilling.visible = (_local2.bonus >= 2);
if (((m_bombButtonFilling.visible) && (!(m_bomb_tooltip_show)))){
m_bomb_tooltip_show = true;
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.BOMB_TOOLTIP, globalToLocal(new Point(m_bombButton.x, m_bombButton.y))));
};
m_lightningButtonFilling.visible = (_local2.bonus >= 3);
if (((m_lightningButtonFilling.visible) && (!(m_lightning_tooltip_show)))){
m_lightning_tooltip_show = true;
m_tooltipEvents.push(new TooltipEventInfo(GameSettings.LIGHTNING_TOOLTIP, globalToLocal(new Point(m_lightningButton.x, m_lightningButton.y))));
};
m_shuffleButton.mode = MyButton.MODE_DISABLED;
m_bombButton.mode = MyButton.MODE_DISABLED;
m_lightningButton.mode = MyButton.MODE_DISABLED;
m_shuffleButtonFilling.save();
m_bombButtonFilling.save();
m_lightningButtonFilling.save();
m_level.addEventListener(PlayingField.ON_BLACK_FIGURE_APPEAR, onBlackFigureAppear);
m_level.addEventListener(PlayingField.ON_TRIANGLE_LOCK_APPEAR, onTriangleLockAppear);
m_level.addEventListener(PlayingField.ON_TRIANGLE_DOUBLE_LOCK_APPEAR, onTriangleDoubleLockAppear);
m_level.addEventListener(PlayingField.ON_TRIANGLE_COLOR_LOCK_APPEAR, onTriangleColorLockAppear);
m_level.addEventListener(PlayingField.ON_FIGURE_CHAIN_APPEAR, onFigureChainAppear);
m_level.addEventListener(PlayingField.ON_FIGURE_DOUBLE_CHAIN_APPEAR, onFigureDoubleChainAppear);
if (stage){
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
};
}
private function onLevelScoreChange(_arg1:ScoreEvent){
var _local2:FlyingNumber;
var _local4:uint;
var _local5:Star;
var _local6:String;
var _local7:Point;
var _local8:Sound;
var _local9:int;
(m_gameScore + m_level.levelScore);
m_gameScoreText.text = String((m_gameScore + m_level.levelScore));
m_RealGameScore = (m_gameScore + m_level.levelScore);
trace("m_RealGameScore=", m_RealGameScore);
_local2 = new FlyingNumber(m_level, String(_arg1.score), m_level.globalToLocal(_arg1.point), m_level.globalToLocal(new Point(_arg1.point.x, (_arg1.point.y - 500))), GameSettings.FLYING_NUMBER_SPEED);
var _local3:uint;
if ((((_arg1.combo > 1)) && (m_bombButtonFilling.visible))){
switch (_arg1.combo){
case 2:
_local3 = GameSettings.BONUS_COMBO2_PERSENT;
break;
case 3:
_local3 = GameSettings.BONUS_COMBO3_PERSENT;
break;
case 4:
_local3 = GameSettings.BONUS_COMBO4_PERSENT;
break;
case 5:
_local3 = GameSettings.BONUS_COMBO5_PERSENT;
break;
default:
_local3 = GameSettings.BONUS_COMBO6_PERSENT;
break;
};
_local4 = 0;
while (_local4 < _arg1.points.length) {
_local7 = _arg1.points[_local4];
_local5 = new Star(this, globalToLocal(_local7), globalToLocal(m_bombButton.localToGlobal(new Point(0, 0))), GameSettings.STAR_SPEED, _local3);
if (_local4 == 0){
_local5.addEventListener(BasicObject.MOVE_FINISH, onBombStarMoveFinish);
};
_local4++;
};
};
if ((((_arg1.clickCombo > 1)) && (m_lightningButtonFilling.visible))){
switch (_arg1.clickCombo){
case 2:
_local3 = GameSettings.BONUS_CLICK_COMBO2_PERSENT;
break;
case 3:
_local3 = GameSettings.BONUS_CLICK_COMBO3_PERSENT;
break;
case 4:
_local3 = GameSettings.BONUS_CLICK_COMBO4_PERSENT;
break;
case 5:
_local3 = GameSettings.BONUS_CLICK_COMBO5_PERSENT;
break;
default:
_local3 = GameSettings.BONUS_CLICK_COMBO6_PERSENT;
break;
};
_local4 = 0;
while (_local4 < _arg1.points.length) {
_local7 = _arg1.points[_local4];
_local5 = new Star(this, globalToLocal(_local7), globalToLocal(m_lightningButton.localToGlobal(new Point(0, 0))), GameSettings.STAR_SPEED, _local3);
if (_local4 == 0){
_local5.addEventListener(BasicObject.MOVE_FINISH, onLightningStarMoveFinish);
};
_local4++;
};
};
if ((_arg1.clickCombo * _arg1.combo) > 1){
if (_arg1.clickCombo > 1){
_local6 = (((GameSettings.CLICK_COMBO_TEXT + " ") + String(_arg1.clickCombo)) + "X");
};
if (_arg1.combo > 1){
_local6 = (((GameSettings.COMBO_TEXT + " ") + String(_arg1.combo)) + "X");
};
_local7 = new Point(_arg1.point.x, _arg1.point.y);
_local7.offset(0, _local2.height);
new FlyingNumber(m_level, _local6, m_level.globalToLocal(_local7), m_level.globalToLocal(new Point(_local7.x, (_local7.y - 500))), GameSettings.FLYING_NUMBER_SPEED);
if (Game.soundOn){
_local9 = Math.max(_arg1.clickCombo, _arg1.combo);
switch (_local9){
case 2:
_local8 = new Burst2Sound();
break;
case 3:
_local8 = new Burst3Sound();
break;
case 4:
_local8 = new Burst4Sound();
break;
default:
_local8 = new Burst5Sound();
break;
};
_local8.play();
};
};
}
private function onBombStarMoveFinish(_arg1:Event){
var _local2:Star = (_arg1.target as Star);
m_bombButtonFilling.percent = (m_bombButtonFilling.percent + _local2.percent);
}
private function onLightningStarMoveFinish(_arg1:Event){
var _local2:Star = (_arg1.target as Star);
m_lightningButtonFilling.percent = (m_lightningButtonFilling.percent + _local2.percent);
}
private function isLevelLoadComplete():Boolean{
return (((m_level) && (!((m_level.getMode() == PlayingField.MODE_LOADING)))));
}
private function onLevelLoadComplete(_arg1:Event){
var _local2:TooltipEventInfo;
m_timer.start();
m_musicPlayer = new MusicPlayer(new LevelSound());
if (musicOn){
m_musicPlayer.play();
};
onLightningButtonUpdate(null);
onShuffleButtonUpdate(null);
onBombButtonUpdate(null);
if (m_tooltipEvents.length){
_local2 = m_tooltipEvents.shift();
showTooltipWindow(_local2.tooltip, _local2.point);
};
}
private function onCloseTimeOutWindow(_arg1:Event){
var _local2:TimeOutWindow = TimeOutWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onCloseTimeOutWindow);
removeChild(_local2);
removeBackgroundWindow();
switch (_local2.action){
case TimeOutWindow.ACTION_PLAY:
loadLevel(m_level.levelNumber);
break;
case TimeOutWindow.ACTION_MAIN_MENU:
endGame();
break;
};
}
private function afterLevelMusicStopOnTimeOut(_arg1:Event){
hideTooltipWindow(true);
addBackgroundWindow();
var _local2:TimeOutWindow = new TimeOutWindow(new Point((bg.width / 2), (bg.height / 2)));
addChild(_local2);
_local2.addEventListener(MyWindow.ON_CLOSE, onCloseTimeOutWindow);
new SoundPlayer(new TimeOutSound());
}
private function onLevelTimerComplete(_arg1:TimerEvent){
m_blinkTimer.stop();
if (m_timerSoundChannel){
m_timerSoundChannel.stop();
};
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, onLevelTimer);
m_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onLevelTimerComplete);
m_timer = null;
if (m_musicPlayer.stop(GameSettings.STOP_MUSIC_DELAY, afterLevelMusicStopOnTimeOut)){
afterLevelMusicStopOnTimeOut(null);
};
}
private function onCloseGameCompleteWindow(_arg1:Event){
var _local2:GameCompleteWindow = GameCompleteWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onCloseGameCompleteWindow);
removeChild(_local2);
removeBackgroundWindow();
endGame();
}
private function afterLevelSoundStopOnLevelComplete(_arg1:Event){
hideTooltipWindow(true);
addBackgroundWindow();
var _local2:LevelCompleteWindow = new LevelCompleteWindow(new Point((bg.width / 2), (bg.height / 2)), m_level.levelScore, m_timeScore);
addChild(_local2);
_local2.addEventListener(MyWindow.ON_CLOSE, onCloseLevelCompleteWindow);
new SoundPlayer(new LevelCompleteSound());
}
private function onLevelComplete(_arg1:Event){
m_timeScore = ((m_timer.repeatCount - m_timer.currentCount) * GameSettings.TIME_SCORE);
m_timer.stop();
m_timer.removeEventListener(TimerEvent.TIMER, onLevelTimer);
m_timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onLevelTimerComplete);
m_timer = null;
m_blinkTimer.stop();
if (m_timerSoundChannel){
m_timerSoundChannel.stop();
};
m_gameScore = (m_gameScore + (m_level.levelScore + m_timeScore));
if (m_musicPlayer.stop(GameSettings.STOP_MUSIC_DELAY, afterLevelSoundStopOnLevelComplete)){
afterLevelSoundStopOnLevelComplete(null);
};
}
private function onCloseLevelCompleteWindow(_arg1:Event){
var _local3:GameCompleteWindow;
var _local2:LevelCompleteWindow = LevelCompleteWindow(_arg1.target);
removeChild(_local2);
if (m_level.levelNumber == m_level_info_array.length){
_local3 = new GameCompleteWindow(new Point((bg.width / 2), (bg.height / 2)));
addChild(_local3);
_local3.addEventListener(MyWindow.ON_CLOSE, onCloseGameCompleteWindow);
if (Game.soundOn){
new Win1Sound().play();
};
} else {
removeBackgroundWindow();
loadLevel((m_level.levelNumber + 1));
};
}
private function showTooltipWindow(_arg1:uint, _arg2:Point){
if (((m_tooltipWindow) && (contains(m_tooltipWindow)))){
m_tooltipEvents.push(new TooltipEventInfo(_arg1, _arg2));
return;
};
m_tooltipWindow = new TooltipWindow(new Point((bg.width / 2), (bg.height / 2)), _arg2, _arg1, new Point(0, 0), new Point(bg.width, bg.height));
addChild(m_tooltipWindow);
if (Game.soundOn){
new HintSound().play();
};
m_tooltipWindow.addEventListener(MyWindow.ON_CLOSE, onTooltipWindowTimerComplete);
gamePause = true;
}
private function hideTooltipWindow(_arg1:Boolean=false){
var _local2:TooltipEventInfo;
if (((m_tooltipWindow) && (contains(m_tooltipWindow)))){
m_tooltipWindowTimer = null;
removeChild(m_tooltipWindow);
m_tooltipWindow = null;
if (((m_tooltipEvents.length) && (!(_arg1)))){
_local2 = m_tooltipEvents.shift();
showTooltipWindow(_local2.tooltip, _local2.point);
} else {
m_tooltipEvents.length = 0;
gamePause = false;
};
};
}
private function onTooltipWindowTimerComplete(_arg1:Event){
hideTooltipWindow();
}
private function onLevelTimer(_arg1:TimerEvent){
var _local2:uint = ((m_timer.currentCount * m_levelTimer.totalFrames) / m_timer.repeatCount);
m_levelTimer.gotoAndStop(_local2);
if (m_timer.currentCount >= (m_timer.repeatCount / 2)){
if (!m_timer_tooltip_show){
m_timer_tooltip_show = true;
showTooltipWindow(GameSettings.TIMER_TOOLTIP, new Point(bg.width, (bg.height / 2)));
};
};
if (m_shuffleButtonFilling.visible){
m_shuffleButtonFilling.percent = (m_shuffleButtonFilling.percent + (100 / GameSettings.SHUFFLE_TIME_COUNT));
};
if (((m_timer.currentCount * 100) / m_timer.repeatCount) >= (100 - GameSettings.LITLE_TIME)){
m_timerSound = new RunningTimeSound();
if (Game.soundOn){
m_timerSoundChannel = m_timerSound.play();
};
m_blinkTimer.start();
};
}
private function onBlinkTimer(_arg1:TimerEvent){
m_levelTimer.visible = !(m_levelTimer.visible);
}
private function onShuffleButtonClick(_arg1:Event){
if (((m_level.isPlayerMove()) || (!((m_level.getMode() == PlayingField.MODE_NORMAL))))){
return;
};
if (Game.soundOn){
new Shuffle1Sound().play();
};
m_level.shuffle();
m_shuffleButtonFilling.percent = 0;
}
private function onBombButtonClick(_arg1:Event){
if (((m_level.isPlayerMove()) || (!((m_level.getMode() == PlayingField.MODE_NORMAL))))){
return;
};
m_level.bomb();
if (m_level.getMode() == PlayingField.MODE_BOMB){
if (Game.soundOn){
new BombaSound().play();
};
m_cursor.mode = Cursor.MODE_BOMB;
m_level.addEventListener(PlayingField.ON_BOMB_USE, onBombFinish);
addEventListener(MouseEvent.CLICK, OnBombMouseClick);
} else {
throw (new Error("После нажатия на бонус бомба поле не перешло в режим бомбы"));
};
}
private function OnBombMouseClick(_arg1:MouseEvent){
if (m_level.getMode() != PlayingField.MODE_BOMB){
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
return;
};
if (!m_level.haveTriangleByPoint(new Point(_arg1.stageX, _arg1.stageY))){
m_level.cancelBomb();
if (m_level.getMode() == PlayingField.MODE_NORMAL){
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
m_level.removeEventListener(PlayingField.ON_BOMB_USE, onBombFinish);
m_cursor.mode = Cursor.MODE_NORMAL;
} else {
throw (new Error("После отмены бомбы поле не перешло в нормальный режим"));
};
};
}
private function onBombFinish(_arg1:Event){
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
m_level.removeEventListener(PlayingField.ON_BOMB_USE, onBombFinish);
if (m_level.getMode() == PlayingField.MODE_BOMB){
if (m_bombButtonFilling.percent >= 100){
m_bombButtonFilling.percent = (m_bombButtonFilling.percent - 100);
m_cursor.mode = Cursor.MODE_NORMAL;
} else {
throw (new Error("Бомба ещё не заполнена"));
};
} else {
throw (new Error("После применения бомбы поле не в режиме цветной бомбы"));
};
}
private function onLightningTimerComplete(_arg1:TimerEvent){
m_level.lightnings(m_lightningPoints);
m_lightningTimer = null;
m_lightningPoints = null;
m_lightningButtonFilling.percent = (m_lightningButtonFilling.percent - 100);
}
private function onLightningTimer(_arg1:TimerEvent){
var _local2:Point = m_lightningPoints[(m_lightningTimer.currentCount - 1)];
var _local3:MyLightning = new MyLightning(new Point(m_lightningButton.x, m_lightningButton.y), _local2);
addChild(_local3);
m_level.lightning(_local2);
}
private function onLightningButtonClick(_arg1:Event){
if (((m_level.isPlayerMove()) || (!((m_level.getMode() == PlayingField.MODE_NORMAL))))){
return;
};
if (Game.soundOn){
new Lightning1Sound().play();
};
m_lightningPoints = m_level.getRandomPoints();
m_lightningTimer = new Timer(GameSettings.LIGHTNING_DELAY, m_lightningPoints.length);
m_lightningTimer.addEventListener(TimerEvent.TIMER, onLightningTimer);
m_lightningTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLightningTimerComplete);
m_lightningTimer.start();
}
private function set soundOn(_arg1:Boolean){
var _local2:Boolean;
if (m_soundOn == _arg1){
return;
};
m_soundOn = _arg1;
if (!m_soundOn){
_local2 = ((m_musicPlayer) && (m_musicPlayer.soundChannel));
m_musicPlayer.pause();
SoundMixer.stopAll();
if (((m_musicOn) && (_local2))){
m_musicPlayer.play();
};
};
}
private function set musicOn(_arg1:Boolean){
if (m_musicOn == _arg1){
return;
};
m_musicOn = _arg1;
if (((!(m_musicOn)) && (m_musicPlayer))){
m_musicPlayer.pause();
};
if (((m_musicOn) && (m_musicPlayer))){
m_musicPlayer.play();
};
}
private function set gamePause(_arg1:Boolean):void{
if (m_gamePause == _arg1){
return;
};
m_gamePause = _arg1;
if (m_gamePause){
if (m_level){
m_level.gamePause();
};
if (m_timer){
m_timer.stop();
};
setButtonEnabled(false);
} else {
if (m_level){
m_level.gameContinue();
};
if (m_timer){
m_timer.start();
};
setButtonEnabled(true);
};
}
public static function get gamePause():Boolean{
return (m_gamePause);
}
public static function get soundOn():Boolean{
return (m_soundOn);
}
public static function get musicOn():Boolean{
return (m_musicOn);
}
public static function get getScore():uint{
return (m_RealGameScore);
}
}
}//package main
Section 57 (1.71 KiB) ●
//GameCompleteWindow (main.GameCompleteWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
import flash.net.*;
public class GameCompleteWindow extends MyWindow {
public var m_OKBtn:SimpleButton;
public var m_submitScoreButton:SimpleButton;
public var txtName:TextField;
public var m_submitScoreText:TextField;
public var m_downloadBtn:SimpleButton;
public function GameCompleteWindow(_arg1:Point){
super(_arg1, false);
m_OKBtn.addEventListener(MouseEvent.CLICK, onOkBtnClick);
m_downloadBtn.addEventListener(MouseEvent.CLICK, onDownloadBtnClick);
m_submitScoreButton.addEventListener(MouseEvent.CLICK, onSubmitBtnClick);
m_submitScoreText.text = String(Game.getScore);
}
private function onOkBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onDownloadBtnClick(_arg1:Event):void{
var event = _arg1;
new SoundPlayer(new Button1Sound());
var url:String = GameSettings.DOWNLOAD_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function onSubmitBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
navigateToURL(new URLRequest(((((("http://www.playonlinepuzzles.com/score.php?&gameid=angkorquest&score=" + Game.getScore) + "&name=") + this.txtName.text) + "&key=") + (((Game.getScore * Game.getScore) + (5 * Game.getScore)) + 34).toString())), "_blank");
m_submitScoreButton.removeEventListener(MouseEvent.CLICK, onSubmitBtnClick);
}
}
}//package main
Section 58 (3.38 KiB) ●
//GameMenuWindow (main.GameMenuWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.net.*;
public class GameMenuWindow extends MyWindow {
public var m_abortGameBtn:SimpleButton;
public var m_continueBtn:SimpleButton;
public var m_url1Btn:SimpleButton;
public var m_restartLevelBtn:SimpleButton;
public var m_helpBtn:SimpleButton;
private var m_action:uint;// = 0
public static const ACTION_NONE = 0;
public static const ACTION_CONTINUE = 1;
public static const ACTION_RESTART_LEVEL = 2;
public static const ACTION_ABORT_GAME = 4;
public function GameMenuWindow(_arg1:Point){
super(_arg1, false);
m_continueBtn.addEventListener(MouseEvent.CLICK, onContinueButtonClick);
m_restartLevelBtn.addEventListener(MouseEvent.CLICK, onLevelRestartButtonClick);
m_helpBtn.addEventListener(MouseEvent.CLICK, onHelpButtonClick);
m_abortGameBtn.addEventListener(MouseEvent.CLICK, onAbortGameButtonClick);
m_url1Btn.addEventListener(MouseEvent.CLICK, onURL1BtnClick);
}
public function get action():uint{
return (m_action);
}
private function onLevelRestartButtonClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
var _local2:SureWindow = new SureWindow(new Point(0, 0), GameSettings.SURE_RESTART_LEVEL);
_local2.addEventListener(MyWindow.ON_CLOSE, onSureWindowClose);
addChild(_local2);
}
private function onSureWindowClose(_arg1:Event){
var _local2:SureWindow = SureWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onSureWindowClose);
removeChild(_local2);
if (_local2.action == SureWindow.ACTION_OK){
m_action = ACTION_RESTART_LEVEL;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
};
}
private function onContinueButtonClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_CONTINUE;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onHelpButtonClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
var _local2:* = new HelpWindow(new Point(0, 0));
_local2.addEventListener(MyWindow.ON_CLOSE, onHelpClose);
addChild(_local2);
}
private function onHelpClose(_arg1:Event):void{
var _local2:* = HelpWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onHelpClose);
removeChild(_local2);
}
private function onAbortGameButtonClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_ABORT_GAME;
var _local2:SureWindow = new SureWindow(new Point(0, 0), GameSettings.SURE_ABORT_GAME);
_local2.addEventListener(MyWindow.ON_CLOSE, onSureWindowClose2);
addChild(_local2);
}
private function onURL1BtnClick(_arg1:Event):void{
var event = _arg1;
if (Game.soundOn){
new Button1Sound().play();
};
var url:String = GameSettings.DOWNLOAD_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function onSureWindowClose2(_arg1:Event){
var _local2:SureWindow = SureWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onSureWindowClose2);
removeChild(_local2);
if (_local2.action == SureWindow.ACTION_OK){
m_action = ACTION_ABORT_GAME;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
};
}
}
}//package main
Section 59 (4.69 KiB) ●
//GameSettings (main.GameSettings)
package main {
public class GameSettings {
public static const FrameRate = 24;
public static const SHUFFLE_SPEED = 10;
public static const DROP_SPEED = 17;
public static const TREMBLE_SPEED = 1;
public static const DROP_FIGURE_DELAY = 20;
public static const DROP_TRIANGLE_DELAY = 20;
public static const DROP_OFFSETX = 0;
public static const DROP_OFFSETY = -40;
public static const LITLE_TIME = 10;
public static const FALL_SPEED = 17;
public static const ROTATION_SPEED = 18;
public static const PULL_OFFSET = (Triangle.triWidth / 8);
public static const TRIANGLE_ROW_COUNT = 11;
public static const TRIANGLE_COL_COUNT = 8;
public static const FIGURE_RADIUS = 17.5;
public static const MaxBonusFillPercent = 300;
public static const MATCH3 = 30;
public static const MATCH4 = 50;
public static const MATCH5 = 70;
public static const MATCH6 = 100;
public static const MATCH7 = 100;
public static const MATCH8 = 100;
public static const LIGHTNING_DELAY = 250;
public static const FLYING_NUMBER_SPEED = 4;
public static const FLYING_NUMBER_FLY = 500;
public static const FLYING_NUMBER_ALPHA = 500;
public static const CLICK_COMBO_TEXT = "Click-combo";
public static const COMBO_TEXT = "Combo";
public static const LEVEL_NUMBER_TEXT = "Level";
public static const BONUS_MATCH4_COUNT = 7;
public static const SHUFFLE_TIME_COUNT = 90;
public static const BACKGROUND_WINDOW_ALPHA = 0;
public static const TIP_POINTER_START = 76;
public static const TIP_WINDOW_START = 100;
public static const BONUS_MATCH6_PERSENT = 25;
public static const BONUS_MATCH5_PERSENT = 15;
public static const BONUS_COMBO2_PERSENT = 10;
public static const BONUS_COMBO3_PERSENT = 15;
public static const BONUS_COMBO4_PERSENT = 20;
public static const BONUS_COMBO5_PERSENT = 25;
public static const BONUS_COMBO6_PERSENT = 30;
public static const BONUS_CLICK_COMBO2_PERSENT = 10;
public static const BONUS_CLICK_COMBO3_PERSENT = 15;
public static const BONUS_CLICK_COMBO4_PERSENT = 20;
public static const BONUS_CLICK_COMBO5_PERSENT = 25;
public static const BONUS_CLICK_COMBO6_PERSENT = 30;
public static const TOOLTIP_DELAY = 3000;
public static const TIMER_TOOLTIP = 1;
public static const MATCH4_TOOLTIP = 2;
public static const MATCH5_TOOLTIP = 3;
public static const CLICK_COMBO_TOOLTIP = 4;
public static const BLACK_FIGURE_TOOLTIP = 5;
public static const LOCK_TOOLTIP = 6;
public static const DOUBLE_LOCK_TOOLTIP = 7;
public static const COLOR_LOCK_TOOLTIP = 8;
public static const CHAIN_TOOLTIP = 9;
public static const DOUBLE_CHAIN_TOOLTIP = 10;
public static const SHUFFLE_TOOLTIP = 11;
public static const BOMB_TOOLTIP = 12;
public static const LIGHTNING_TOOLTIP = 13;
public static const COLOR_BOMB_TOOLTIP = 14;
public static const CLEANER_TOOLTIP = 15;
public static const CLOCK_TOOLTIP = 16;
public static const BOMB_FULL_TOOLTIP = 17;
public static const LIGHTNING_FULL_TOOLTIP = 18;
public static const DOWNLOAD_URL = "http://www.playonlinepuzzles.com/?from=AngkorQuest";
public static const MORE_GAME_URL = "http://www.playonlinepuzzles.com/?from=AngkorQuest";
public static const SURE_ABORT_GAME = "Are you sure you want to abort?";
public static const SURE_RESTART_LEVEL = "Are you sure you wish to restart the level?";
public static const SURE_EXIT = "Are you sure you want to exit the game?";
public static const SURE_LOAD_GAME = "The saved game will be deleted. Are you sure?";
public static const SURE_DELETE_PROFILE = "Are you sure you want to delete the profile?";
public static const CONFIRM_PROFILE_EXIST = "Such profile already exists. Change the name.";
public static const CLOCK_VISIBLE_TIME = 20000;
public static const CLOCK_ALPHA_CHANGE_TIME = 3000;
public static const CLOCK_TIMER_DELAY = 20000;
public static const CLOCK_TIMER_DELAY_PERCENT = 40;
public static const STAR_SPEED = 15;
public static const CLOCK_TIMER_ADD = 60;
public static const PROFILE_DIR = "Saves\";
public static const PROFILE_LIST_FILE_NAME = "Profiles.txt";
public static const FILE_LIST_FILE_NAME = "Files.txt";
public static const CURR_PROFILE_FILE_NAME = "CurrProfile.txt";
public static const LEVEL_BUTTON_COUNT = 5;
public static const LEVEL_BUTTON_LEVEL_COUNT = 2;
public static const OPTIONS_FILENAME = "Options.txt";
public static const PlayingFieldLaphaChanheDelay = 1000;
public static const GameBackGroundAlphaDelay = 3000;
public static const MAX_PROFILE_LENGTH = 12;
public static const PLAY_BTN_LABEL = "Continue Saved Game";
public static const MAIN_MENU_BTN_LABEL = "Main menu";
public static const TIME_SCORE = 10;
public static const STOP_MUSIC_DELAY = 300;
}
}//package main
Section 60 (308 B)
//HelpTooltipWindow (main.HelpTooltipWindow)
package main {
import flash.geom.*;
import flash.display.*;
public class HelpTooltipWindow extends MyWindow {
public var m_help:MovieClip;
public function HelpTooltipWindow(_arg1:Point){
super(_arg1);
m_help.gotoAndStop(1);
}
}
}//package main
Section 61 (1.34 KiB) ●
//HelpWindow (main.HelpWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class HelpWindow extends MyWindow {
public var m_help:MovieClip;
public var m_OKBtn:SimpleButton;
public var m_backBtn:SimpleButton;
public var m_nextBtn:SimpleButton;
public function HelpWindow(_arg1:Point){
super(_arg1, false);
m_help.gotoAndStop(1);
updateButtons();
m_backBtn.addEventListener(MouseEvent.CLICK, onBackBtnClick);
m_nextBtn.addEventListener(MouseEvent.CLICK, onNextBtnClick);
m_OKBtn.addEventListener(MouseEvent.CLICK, onOkBtnClick);
}
private function onOkBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onBackBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_help.gotoAndStop(Math.max(1, (m_help.currentFrame - 1)));
updateButtons();
}
private function onNextBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_help.gotoAndStop(Math.min(m_help.totalFrames, (m_help.currentFrame + 1)));
updateButtons();
}
private function updateButtons(){
m_backBtn.enabled = (m_help.currentFrame > 1);
m_nextBtn.enabled = (m_help.currentFrame < m_help.totalFrames);
}
}
}//package main
Section 62 (136 B)
//HintSound (main.HintSound)
package main {
import flash.media.*;
public dynamic class HintSound extends Sound {
}
}//package main
Section 63 (157 B)
//LevelBegin1Sound (main.LevelBegin1Sound)
package main {
import flash.media.*;
public dynamic class LevelBegin1Sound extends Sound {
}
}//package main
Section 64 (157 B)
//LevelBegin2Sound (main.LevelBegin2Sound)
package main {
import flash.media.*;
public dynamic class LevelBegin2Sound extends Sound {
}
}//package main
Section 65 (163 B)
//LevelCompleteSound (main.LevelCompleteSound)
package main {
import flash.media.*;
public dynamic class LevelCompleteSound extends Sound {
}
}//package main
Section 66 (1.26 KiB) ●
//LevelCompleteWindow (main.LevelCompleteWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
import flash.net.*;
public class LevelCompleteWindow extends MyWindow {
public var m_totalScoreText:TextField;
public var m_OKBtn:SimpleButton;
public var m_timeScoreText:TextField;
public var m_levelScoreText:TextField;
public var m_downloadBtn:SimpleButton;
public function LevelCompleteWindow(_arg1:Point, _arg2:uint, _arg3:uint){
super(_arg1, false);
m_levelScoreText.text = String(_arg2);
m_timeScoreText.text = String(_arg3);
m_totalScoreText.text = String((_arg2 + _arg3));
m_OKBtn.addEventListener(MouseEvent.CLICK, onOKBtnClick);
m_downloadBtn.addEventListener(MouseEvent.CLICK, onDownloadBtnClick);
}
private function onOKBtnClick(_arg1:Event):void{
new SoundPlayer(new Button1Sound());
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onDownloadBtnClick(_arg1:Event):void{
var event = _arg1;
new SoundPlayer(new Button1Sound());
var url:String = GameSettings.DOWNLOAD_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package main
Section 67 (1.98 KiB) ●
//LevelInfo (main.LevelInfo)
package main {
public class LevelInfo {
protected var m_tri_modes:Array;
protected var m_figureInfoSet:Array;
protected var m_time:uint;
protected var m_blackFigurePercent:uint;
protected var m_figureColorCount:uint;
protected var m_bonus:uint;
public function LevelInfo(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint=1){
m_time = _arg3;
if (_arg4 > 20){
throw (new Error("% чёрных фигур должен быть от 0 до 20%"));
};
m_blackFigurePercent = _arg4;
if ((((_arg5 < 5)) || ((_arg5 > 7)))){
throw (new Error("Количество цветов фигур должно быть от 5 до 7"));
};
m_figureColorCount = _arg5;
if ((((_arg6 < 1)) || ((_arg6 > 5)))){
throw (new Error("Кол-во бонусов должно быть от 1 до 5"));
};
m_bonus = _arg6;
m_tri_modes = _arg1;
if (_arg1.length != GameSettings.TRIANGLE_ROW_COUNT){
_arg1.length = GameSettings.TRIANGLE_ROW_COUNT;
};
var _local7:int;
while (_local7 < m_tri_modes.length) {
if (!(m_tri_modes[_local7] is Array)){
m_tri_modes[_local7] = new Array(GameSettings.TRIANGLE_COL_COUNT);
};
if (m_tri_modes[_local7].length != GameSettings.TRIANGLE_COL_COUNT){
m_tri_modes[_local7].length = GameSettings.TRIANGLE_COL_COUNT;
};
_local7++;
};
m_figureInfoSet = _arg2;
}
public function get bonus():uint{
return (m_bonus);
}
public function get figureColorCount():uint{
return (m_figureColorCount);
}
public function get blackFigurePercent():uint{
return (m_blackFigurePercent);
}
public function get time():uint{
return (m_time);
}
public function getFigureInfo(_arg1:int):FigureInfo{
var _local2:FigureInfo;
for each (_local2 in m_figureInfoSet) {
if (_local2.index == _arg1){
return (_local2);
};
};
return (new FigureInfo(_arg1, Chains.MODE_NO_CHAIN));
}
public function getTriMode(_arg1:int, _arg2:int):int{
return (m_tri_modes[_arg1][_arg2]);
}
}
}//package main
Section 68 (390 B)
//LevelNumber (main.LevelNumber)
package main {
import flash.geom.*;
import flash.text.*;
public class LevelNumber extends BasicObject {
public var m_text:TextField;
public function LevelNumber(_arg1:uint, _arg2:Point){
m_text.text = ((GameSettings.LEVEL_NUMBER_TEXT + " ") + String(_arg1));
m_text.selectable = false;
x = _arg2.x;
y = _arg2.y;
}
}
}//package main
Section 69 (139 B)
//LevelSound (main.LevelSound)
package main {
import flash.media.*;
public dynamic class LevelSound extends Sound {
}
}//package main
Section 70 (142 B)
//Lightning (main.Lightning)
package main {
import flash.display.*;
public dynamic class Lightning extends MovieClip {
}
}//package main
Section 71 (154 B)
//Lightning1Sound (main.Lightning1Sound)
package main {
import flash.media.*;
public dynamic class Lightning1Sound extends Sound {
}
}//package main
Section 72 (561 B)
//LightningButton (main.LightningButton)
package main {
import flash.display.*;
public class LightningButton extends MyButton {
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MyButton.MODE_NORMAL:
return (new LightningMovieNormal());
case MyButton.MODE_OVER:
return (new LightningMovieOver());
case MyButton.MODE_PRESSED:
return (new LightningMoviePressed());
case MyButton.MODE_DISABLED:
return (new LightningMovieDisabled());
};
return (null);
}
}
}//package main
Section 73 (151 B)
//LightningEnd (main.LightningEnd)
package main {
import flash.display.*;
public dynamic class LightningEnd extends MovieClip {
}
}//package main
Section 74 (181 B)
//LightningMovieDisabled (main.LightningMovieDisabled)
package main {
import flash.display.*;
public dynamic class LightningMovieDisabled extends MovieClip {
}
}//package main
Section 75 (175 B)
//LightningMovieNormal (main.LightningMovieNormal)
package main {
import flash.display.*;
public dynamic class LightningMovieNormal extends MovieClip {
}
}//package main
Section 76 (169 B)
//LightningMovieOver (main.LightningMovieOver)
package main {
import flash.display.*;
public dynamic class LightningMovieOver extends MovieClip {
}
}//package main
Section 77 (178 B)
//LightningMoviePressed (main.LightningMoviePressed)
package main {
import flash.display.*;
public dynamic class LightningMoviePressed extends MovieClip {
}
}//package main
Section 78 (130 B)
//Lock1 (main.Lock1)
package main {
import flash.display.*;
public dynamic class Lock1 extends MovieClip {
}
}//package main
Section 79 (130 B)
//Lock2 (main.Lock2)
package main {
import flash.display.*;
public dynamic class Lock2 extends MovieClip {
}
}//package main
Section 80 (130 B)
//Lock3 (main.Lock3)
package main {
import flash.display.*;
public dynamic class Lock3 extends MovieClip {
}
}//package main
Section 81 (130 B)
//Lock4 (main.Lock4)
package main {
import flash.display.*;
public dynamic class Lock4 extends MovieClip {
}
}//package main
Section 82 (130 B)
//Lock5 (main.Lock5)
package main {
import flash.display.*;
public dynamic class Lock5 extends MovieClip {
}
}//package main
Section 83 (130 B)
//Lock6 (main.Lock6)
package main {
import flash.display.*;
public dynamic class Lock6 extends MovieClip {
}
}//package main
Section 84 (130 B)
//Lock7 (main.Lock7)
package main {
import flash.display.*;
public dynamic class Lock7 extends MovieClip {
}
}//package main
Section 85 (133 B)
//LockB1 (main.LockB1)
package main {
import flash.display.*;
public dynamic class LockB1 extends MovieClip {
}
}//package main
Section 86 (133 B)
//LockB2 (main.LockB2)
package main {
import flash.display.*;
public dynamic class LockB2 extends MovieClip {
}
}//package main
Section 87 (1.14 KiB) ●
//Locks (main.Locks)
package main {
import flash.display.*;
public class Locks extends ObjectManager {
public static const MODE_NO_LOCK = 1;
public static const MODE_LOCK = 2;
public static const MODE_DOUBLE_LOCK = 3;
public static const MODE_COLOR_LOCK_1 = 7;
public static const MODE_COLOR_LOCK_2 = 8;
public static const MODE_COLOR_LOCK_3 = 9;
public static const MODE_COLOR_LOCK_4 = 10;
public static const MODE_COLOR_LOCK_5 = 11;
public static const MODE_COLOR_LOCK_6 = 12;
public static const MODE_COLOR_LOCK_7 = 13;
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MODE_LOCK:
return (new LockB1());
case MODE_DOUBLE_LOCK:
return (new LockB2());
case MODE_COLOR_LOCK_1:
return (new Lock1());
case MODE_COLOR_LOCK_2:
return (new Lock2());
case MODE_COLOR_LOCK_3:
return (new Lock3());
case MODE_COLOR_LOCK_4:
return (new Lock4());
case MODE_COLOR_LOCK_5:
return (new Lock5());
case MODE_COLOR_LOCK_6:
return (new Lock6());
case MODE_COLOR_LOCK_7:
return (new Lock7());
};
return (null);
}
}
}//package main
Section 88 (533 B)
//MainClass (main.MainClass)
package main {
import flash.events.*;
import flash.display.*;
public class MainClass extends MovieClip {
public var m_preloaderMov:preloader;
public function MainClass(){
gotoAndStop(1);
m_preloaderMov.addEventListener(preloader.LOAD_COMPLETE, doOnLoadComplete);
stage.scaleMode = StageScaleMode.NO_SCALE;
}
private function doOnLoadComplete(_arg1:Event){
m_preloaderMov.removeEventListener(preloader.LOAD_COMPLETE, doOnLoadComplete);
gotoAndStop(5);
}
}
}//package main
Section 89 (2.69 KiB) ●
//MainMenuWindow (main.MainMenuWindow)
package main {
import flash.media.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.net.*;
public class MainMenuWindow extends MovieClip {
public var m_newGameBtn:SimpleButton;
public var m_url2Btn:SimpleButton;
public var m_url2Btn_2:SimpleButton;
public var m_helpBtn:SimpleButton;
private var m_cursor:Cursor;
private var m_menuSound:MenuSound;
private var m_menuSoundChannel:SoundChannel;
public function MainMenuWindow(_arg1:Cursor){
m_menuSound = new MenuSound();
super();
m_cursor = _arg1;
m_newGameBtn.addEventListener(MouseEvent.CLICK, onNewGameBtnClick);
m_helpBtn.addEventListener(MouseEvent.CLICK, onHelpBtnClick);
m_url2Btn.addEventListener(MouseEvent.CLICK, onURL2BtnClick);
m_url2Btn_2.addEventListener(MouseEvent.CLICK, onURL2BtnClick);
if (Game.musicOn){
m_menuSoundChannel = m_menuSound.play(0, 1000000);
};
}
private function onNewGameBtnClick(_arg1:Event):void{
var _local2:Game;
var _local3:Point;
m_menuSoundChannel.stop();
if (Game.soundOn){
new Button1Sound().play();
};
_local2 = new Game(m_cursor);
_local2.addEventListener(Game.GAME_END, onEndGame);
_local3 = globalToLocal(new Point(0, 0));
_local2.x = _local3.x;
_local2.y = _local3.y;
addChild(_local2);
}
private function onEndGame(_arg1:Event):void{
var _local2:Game = Game(_arg1.target);
_local2.removeEventListener(Game.GAME_END, onEndGame);
removeChild(_local2);
if (Game.musicOn){
m_menuSoundChannel = m_menuSound.play(0, 1000000);
};
}
private function onHelpClose(_arg1:Event):void{
var _local2:* = HelpWindow(_arg1.target);
_local2.removeEventListener(MyWindow.ON_CLOSE, onHelpClose);
removeChild(_local2);
}
private function onHelpBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
var _local2:* = new HelpWindow(new Point(0, 0));
_local2.addEventListener(MyWindow.ON_CLOSE, onHelpClose);
addChild(_local2);
}
private function onURL1BtnClick(_arg1:Event):void{
var event = _arg1;
if (Game.soundOn){
new Button1Sound().play();
};
var url:String = GameSettings.DOWNLOAD_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
private function onURL2BtnClick(_arg1:Event):void{
var event = _arg1;
if (Game.soundOn){
new Button1Sound().play();
};
var url:String = GameSettings.MORE_GAME_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package main
Section 90 (244 B)
//MenuBackgroundWindow (main.MenuBackgroundWindow)
package main {
import flash.geom.*;
public class MenuBackgroundWindow extends MyWindow {
public function MenuBackgroundWindow(_arg1:Point){
super(_arg1, false);
}
}
}//package main
Section 91 (136 B)
//MenuSound (main.MenuSound)
package main {
import flash.media.*;
public dynamic class MenuSound extends Sound {
}
}//package main
Section 92 (728 B)
//MoveEvent (main.MoveEvent)
package main {
import flash.events.*;
import flash.geom.*;
public class MoveEvent extends Event {
private var m_startPoint:Point;
private var m_stopPoint:Point;
private var m_speed:Number;
public function MoveEvent(_arg1:String, _arg2:Point, _arg3:Point, _arg4:Number, _arg5:Boolean=false, _arg6:Boolean=false){
super(_arg1, _arg5, _arg6);
m_startPoint = new Point(_arg2.x, _arg2.y);
m_stopPoint = new Point(_arg3.x, _arg3.y);
m_speed = _arg4;
}
public function get startPoint():Point{
return (m_startPoint);
}
public function get speed():Number{
return (m_speed);
}
public function get stopPoint():Point{
return (m_stopPoint);
}
}
}//package main
Section 93 (2.47 KiB) ●
//MusicPlayer (main.MusicPlayer)
package main {
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class MusicPlayer {
private var m_soundChannel:SoundChannel;// = null
private var m_soundTransform:SoundTransform;// = null
private var m_soundChannelPosition:Number;// = 0
private var m_sound:Sound;
private var m_stopTimer:Timer;
private var m_dec_volume:Number;
public function MusicPlayer(_arg1:Sound){
m_soundTransform = new SoundTransform(1);
m_sound = _arg1;
}
public function play(){
m_soundChannel = m_sound.play(m_soundChannelPosition);
m_soundChannel.soundTransform = m_soundTransform;
m_soundChannel.addEventListener(Event.SOUND_COMPLETE, playSoundComplete);
}
private function playSoundComplete(_arg1:Event){
m_soundChannel.removeEventListener(Event.SOUND_COMPLETE, playSoundComplete);
m_soundChannel = m_sound.play();
m_soundChannel.soundTransform = m_soundTransform;
m_soundChannel.addEventListener(Event.SOUND_COMPLETE, playSoundComplete);
}
public function pause(){
if (m_soundChannel){
m_soundChannelPosition = m_soundChannel.position;
m_soundChannel.stop();
m_soundChannel = null;
} else {
m_soundChannelPosition = 0;
};
}
public function get soundChannel():SoundChannel{
return (m_soundChannel);
}
private function stopTimerHandler(_arg1:Event){
m_soundTransform.volume = (m_soundTransform.volume - m_dec_volume);
if (m_soundChannel){
m_soundChannel.soundTransform = m_soundTransform;
};
}
private function stopTimerComplete(_arg1:Event){
m_stopTimer.removeEventListener(TimerEvent.TIMER, stopTimerHandler);
m_stopTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, stopTimerComplete);
m_stopTimer = null;
if (m_soundChannel){
m_soundChannel.stop();
};
m_soundChannel = null;
m_soundTransform.volume = 1;
}
public function stop(_arg1:uint, _arg2:Function):Boolean{
if (!m_soundChannel){
return (true);
};
if (_arg1 == 0){
m_soundChannel.stop();
m_soundChannel = null;
return (true);
};
m_stopTimer = new Timer(100, (_arg1 / 100));
m_dec_volume = (m_soundTransform.volume / m_stopTimer.repeatCount);
m_stopTimer.addEventListener(TimerEvent.TIMER, stopTimerHandler);
m_stopTimer.addEventListener(TimerEvent.TIMER_COMPLETE, stopTimerComplete);
if (_arg2 != null){
m_stopTimer.addEventListener(TimerEvent.TIMER_COMPLETE, _arg2);
};
m_stopTimer.start();
return (false);
}
}
}//package main
Section 94 (1.35 KiB) ●
//MyButton (main.MyButton)
package main {
import flash.events.*;
public class MyButton extends ObjectManager2 {
private var m_i:int;// = 0
public static const BUTTON_CLICK = "buttonClick";
public static const DISABLED_BUTTON_CLICK = "disabledButtonClick";
public static const MODE_NORMAL = 1;
public static const MODE_OVER = 2;
public static const MODE_PRESSED = 3;
public static const MODE_DISABLED = 4;
public function MyButton(){
gotoAndStop(2);
mode = MODE_NORMAL;
addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
addEventListener(MouseEvent.MOUSE_OUT, OnMouseOut);
addEventListener(MouseEvent.MOUSE_DOWN, OnMouseDown);
addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
}
private function OnMouseMove(_arg1:MouseEvent):void{
if (mode == MODE_DISABLED){
return;
};
mode = MODE_OVER;
}
private function OnMouseOut(_arg1:MouseEvent):void{
if (mode == MODE_DISABLED){
return;
};
mode = MODE_NORMAL;
trace(("out" + m_i++));
}
private function OnMouseDown(_arg1:MouseEvent):void{
if (mode == MODE_DISABLED){
return;
};
mode = MODE_PRESSED;
}
private function OnMouseUp(_arg1:MouseEvent):void{
if (mode == MODE_DISABLED){
dispatchEvent(new Event(DISABLED_BUTTON_CLICK));
} else {
mode = MODE_OVER;
dispatchEvent(new Event(BUTTON_CLICK));
};
}
}
}//package main
Section 95 (1.4 KiB) ●
//MyLightning (main.MyLightning)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class MyLightning extends MovieClip {
private var m_lightning:Lightning;
private var m_lightningEnd:LightningEnd;
public function MyLightning(_arg1:Point, _arg2:Point){
var _local6:Number;
super();
m_lightning = new Lightning();
m_lightning.x = _arg1.x;
m_lightning.y = _arg1.y;
m_lightningEnd = new LightningEnd();
m_lightningEnd.x = _arg2.x;
m_lightningEnd.y = _arg2.y;
var _local3:Number = Point.distance(_arg1, _arg2);
var _local4:Number = _local3;
var _local5:Point = new Point((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
_local6 = Math.asin((-(_local5.y) / Math.sqrt(((_local5.x * _local5.x) + (_local5.y * _local5.y)))));
if (_local5.x < 0){
_local6 = (Math.PI - _local6);
};
var _local7:Number = ((180 * _local6) / Math.PI);
var _local8:Number = ((-180 * _local6) / Math.PI);
m_lightning.width = _local4;
m_lightning.rotation = _local8;
addEventListener(Event.ENTER_FRAME, myOnEnterFrame);
addChild(m_lightning);
addChild(m_lightningEnd);
}
private function myOnEnterFrame(_arg1:Event){
if (((m_lightning) && ((m_lightning.currentFrame == m_lightning.totalFrames)))){
if (parent){
parent.removeChild(this);
};
addEventListener(Event.ENTER_FRAME, myOnEnterFrame);
};
}
}
}//package main
Section 96 (814 B)
//MyTipPointer (main.MyTipPointer)
package main {
import flash.geom.*;
import flash.display.*;
public class MyTipPointer extends MovieClip {
private var m_tipPointer:TipPointer;
public function MyTipPointer(_arg1:Point, _arg2:Point){
var _local4:Number;
super();
m_tipPointer = new TipPointer();
m_tipPointer.x = _arg1.x;
m_tipPointer.y = _arg1.y;
var _local3:Point = new Point((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
_local4 = Math.asin((-(_local3.y) / Math.sqrt(((_local3.x * _local3.x) + (_local3.y * _local3.y)))));
if (_local3.x < 0){
_local4 = (Math.PI - _local4);
};
var _local5:Number = ((180 * _local4) / Math.PI);
var _local6:Number = ((-180 * _local4) / Math.PI);
m_tipPointer.rotation = _local6;
addChild(m_tipPointer);
}
}
}//package main
Section 97 (495 B)
//MyWindow (main.MyWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class MyWindow extends MovieClip {
public static const ON_CLOSE = "onCloseWindow";
public function MyWindow(_arg1:Point, _arg2:Boolean=true){
x = _arg1.x;
y = _arg1.y;
if (_arg2){
addEventListener(MouseEvent.CLICK, OnMouseClick);
};
}
private function OnMouseClick(_arg1:MouseEvent){
dispatchEvent(new Event(ON_CLOSE));
}
}
}//package main
Section 98 (130 B)
//NoSound (main.NoSound)
package main {
import flash.media.*;
public dynamic class NoSound extends Sound {
}
}//package main
Section 99 (1.21 KiB) ●
//ObjectManager (main.ObjectManager)
package main {
import flash.events.*;
import flash.display.*;
public class ObjectManager extends MovieClip {
private var m_mode:int;
private var m_animationClip:MovieClip;
public static const AFTER_MODE_UPDATE = "AfterModeUpdate";
public function get mode():int{
return (m_mode);
}
public function set mode(_arg1:int):void{
if (m_mode == _arg1){
return;
};
if (m_animationClip){
m_animationClip.gotoAndPlay(2);
};
m_mode = _arg1;
addEventListener(Event.ENTER_FRAME, OnModeUpdate);
}
protected function createAnimation(_arg1:int):MovieClip{
return (null);
}
private function OnModeUpdate(_arg1:Event){
if (((!(m_animationClip)) || (((m_animationClip) && ((m_animationClip.currentFrame == m_animationClip.totalFrames)))))){
if (m_animationClip){
m_animationClip.stop();
removeChild(m_animationClip);
m_animationClip = null;
};
removeEventListener(Event.ENTER_FRAME, OnModeUpdate);
m_animationClip = createAnimation(m_mode);
if (m_animationClip){
m_animationClip.gotoAndStop(1);
addChild(m_animationClip);
};
dispatchEvent(new Event(AFTER_MODE_UPDATE));
};
}
}
}//package main
Section 100 (1.74 KiB) ●
//ObjectManager2 (main.ObjectManager2)
package main {
import flash.events.*;
import flash.display.*;
public class ObjectManager2 extends MovieClip {
private var m_mode:int;
private var m_animationClip:MovieClip;
private var m_animationMode:uint;// = 1
public static const CHANGE_MODE_FINISH = "ChangeModeFinish";
public static const ANIMATION_STOP_ON_LAST_CADR = 1;
public static const ANIMATION_CYCLE = 2;
protected function get animationClip():MovieClip{
return (m_animationClip);
}
public function get mode():int{
return (m_mode);
}
public function set mode(_arg1:int):void{
if (m_mode == _arg1){
return;
};
if (m_animationClip){
m_animationClip.stop();
removeChild(m_animationClip);
m_animationClip = null;
};
m_mode = _arg1;
m_animationClip = createAnimation(m_mode);
m_animationMode = getAnimationMode();
if (m_animationClip){
addChild(m_animationClip);
m_animationClip.play();
};
addEventListener(Event.ENTER_FRAME, OnModeUpdate);
}
protected function createAnimation(_arg1:int):MovieClip{
return (null);
}
protected function getAnimationMode():uint{
return (ANIMATION_STOP_ON_LAST_CADR);
}
private function OnModeUpdate(_arg1:Event){
if (m_animationClip){
if ((((m_animationClip.currentFrame == m_animationClip.totalFrames)) && ((m_animationMode == ANIMATION_STOP_ON_LAST_CADR)))){
m_animationClip.stop();
removeEventListener(Event.ENTER_FRAME, OnModeUpdate);
dispatchEvent(new Event(CHANGE_MODE_FINISH));
} else {
if (Game.gamePause){
m_animationClip.stop();
} else {
m_animationClip.play();
};
};
} else {
removeEventListener(Event.ENTER_FRAME, OnModeUpdate);
};
}
}
}//package main
Section 101 (44.04 KiB) ● ● ● ●
//PlayingField (main.PlayingField)
package main {
import flash.media.*;
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class PlayingField extends MovieClip {
private var m_mode:int;// = 1
private var m_levelNumberText:LevelNumber;
private var m_blackFigureTryCount:uint;
private var m_triangles:Array;
private var m_trianglesCount:uint;
private var m_figurePlaces:Array;
private var m_figures:Array;
private var m_figurePlaceCount:uint;
private var m_movingFigures:Array;
private var m_rowCount:int;// = 11
private var m_colCount:int;// = 8
private var m_levelInfo:LevelInfo;
private var m_levelNumber:int;
private var m_rotatedTriangle:Triangle;
private var m_playerMoveIterate:uint;
private var m_clickComboCoeff:uint;
private var m_playerMoveScore:uint;
private var m_levelScore:uint;
private var m_movedfpSet:Array;
private var m_figureTimer:Timer;
private var m_triTimer:Timer;
private var m_timers:Array;
private var m_rotate_sound:Sound;
private var m_rotate_wrong_sound:Sound;
private var m_levelBeginSound:Sound;
private var m_levelBeginSoundChannel:SoundChannel;
public static const LEVEL_COMPLETE = "levelComplete";
public static const LOAD_COMPLETE = "loadComplete";
public static const ON_SCORE_CHANGE = "onScoreChange";
public static const ON_MODE_CHANGE = "onModeChange";
public static const ON_PLAYER_MOVE_START = "onPlayerMoveStart";
public static const ON_PLAYER_MOVE_END = "onPlayerMoveEnd";
public static const ON_BLACK_FIGURE_APPEAR = "onBlackFigureAppear";
public static const ON_TRIANGLE_LOCK_APPEAR = "onTriangleLockAppear";
public static const ON_TRIANGLE_DOUBLE_LOCK_APPEAR = "onTriangleDoubleLockAppear";
public static const ON_TRIANGLE_COLOR_LOCK_APPEAR = "onTriangleColorLockAppear";
public static const ON_FIGURE_CHAIN_APPEAR = "onFigureChainAppear";
public static const ON_FIGURE_DOUBLE_CHAIN_APPEAR = "onFigureDoubleChainAppear";
public static const ON_BOMB_USE = "onBombUse";
public static const MODE_LOADING = 1;
public static const MODE_NORMAL = 2;
public static const MODE_BOMB = 3;
public static const MODE_COMPLETE = 4;
public function PlayingField(_arg1:LevelInfo, _arg2:int){
var _local3:Triangle;
var _local4:Boolean;
var _local6:int;
var _local8:Array;
var _local10:FigurePlace;
var _local11:Array;
var _local12:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:Triangle;
var _local18:uint;
m_timers = new Array();
m_rotate_sound = new RotateSound();
m_rotate_wrong_sound = new RotateWrongSound();
super();
var _local5:Point = new Point(0, 0);
m_levelInfo = _arg1;
m_levelNumber = _arg2;
m_movingFigures = new Array();
m_movedfpSet = new Array();
m_figures = new Array();
m_triangles = new Array();
var _local7:int;
while (_local7 < m_rowCount) {
if ((_local7 % 2) == 0){
_local5.y = (((_local7 / 2) * Triangle.triHeight) + (Triangle.triHeight / 2));
_local4 = false;
} else {
_local5.y = Math.floor((((_local7 / 2) + 0.5) * Triangle.triHeight));
_local4 = true;
};
m_triangles[_local7] = new Array();
_local14 = 0;
while (_local14 < m_colCount) {
_local6 = _arg1.getTriMode(_local7, _local14);
if (_local6 > 0){
m_trianglesCount++;
_local5.x = ((_local14 * Triangle.triWidth) + (Triangle.triWidth / 2));
_local3 = new Triangle(_local5, _local4, _local7, _local14, _local6);
_local3.addEventListener(Triangle.ON_GOLD_TRIANGLE, onGoldTriangle);
m_triangles[_local7][_local14] = _local3;
};
_local4 = !(_local4);
_local14++;
};
_local7++;
};
m_triTimer = new Timer(GameSettings.DROP_TRIANGLE_DELAY, m_trianglesCount);
m_triTimer.addEventListener(TimerEvent.TIMER, onTriTimer);
m_triTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTriTimerComplete);
m_triTimer.start();
m_levelNumberText = new LevelNumber(_arg2, new Point((width / 2), (height / 2)));
addChild(m_levelNumberText);
m_levelBeginSound = new LevelBegin1Sound();
new SoundPlayer(new LevelBegin1Sound());
m_figurePlaces = new Array();
_local7 = 0;
while (_local7 < (m_rowCount + 2)) {
_local5.y = ((_local7 * Triangle.triHeight) / 2);
if ((_local7 % 2) == 0){
_local15 = 5;
} else {
_local15 = 4;
};
m_figurePlaces[_local7] = new Array(_local15);
_local14 = 0;
while (_local14 < _local15) {
if ((_local7 % 2) == 0){
_local5.x = ((_local14 * Triangle.triWidth) * 2);
} else {
_local5.x = (Triangle.triWidth + ((_local14 * Triangle.triWidth) * 2));
};
addChild(new FigurePlace(m_figurePlaces, _local7, _local14, _local5));
_local14++;
};
_local7++;
};
var _local9:Array = new Array();
m_figurePlaceCount = 0;
_local7 = 0;
while (_local7 < m_rowCount) {
_local14 = 0;
while (_local14 < m_colCount) {
_local3 = m_triangles[_local7][_local14];
if (_local3){
_local8 = getFigurePlacesByTriangle(_local3);
for each (_local10 in _local8) {
if (_local9.indexOf(_local10) < 0){
_local9.push(_local10);
m_figurePlaceCount++;
};
};
};
_local14++;
};
_local7++;
};
_local9 = null;
var _local13:Boolean;
_local7 = 0;
while (_local7 < m_rowCount) {
_local14 = 0;
while (_local14 < m_colCount) {
_local3 = m_triangles[_local7][_local14];
if (_local3){
_local8 = getFigurePlacesByTriangle(_local3);
_local16 = 0;
while (_local16 < _local8.length) {
_local10 = _local8[_local16];
if (!_local10.figure){
createFigure(_local10);
if (figureCount(_local3) == 3){
_local12 = trianglesByFigurePlace(_local10);
do {
_local13 = false;
for each (_local17 in _local12) {
if (figureCount(_local17) < 3){
} else {
_local11 = getTriangleFigureColors(_local17);
while (_local11.length == 1) {
_local10.figure.randomFrame();
_local11 = getTriangleFigureColors(_local17);
_local13 = true;
};
};
};
} while (_local13);
};
};
_local16++;
};
switch (_local3.mode){
case Triangle.MODE_COLOR_LOCK_A:
case Triangle.MODE_COLOR_LOCK_B:
case Triangle.MODE_COLOR_LOCK_C:
_local10 = _local8[(_local3.mode - Triangle.MODE_COLOR_LOCK_A)];
if (_local10.figure.black){
_local18 = 1;
} else {
_local18 = _local10.figure.figureIndex;
};
_local3.mode = ((_local18 - 1) + Triangle.MODE_COLOR_LOCK_1);
};
};
_local14++;
};
_local7++;
};
_local7 = (m_figurePlaces.length - 1);
while (_local7 >= 0) {
_local14 = (m_figurePlaces[_local7].length - 1);
while (_local14 >= 0) {
_local10 = m_figurePlaces[_local7][_local14];
if (_local10.figure){
_local10.figure.x = (_local10.figure.x + 1);
} else {
delete m_figurePlaces[_local7][_local14];
};
_local14--;
};
_local7--;
};
m_figureTimer = new Timer(GameSettings.DROP_FIGURE_DELAY, m_figures.length);
m_figureTimer.addEventListener(TimerEvent.TIMER, onFigureTimer);
}
private function addLevelScore(_arg1:uint, _arg2:Point, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:Array){
var _local8:FigurePlace;
var _local7:Array = new Array();
for each (_local8 in _arg6) {
_local7.push(localToGlobal(_local8.point));
};
m_levelScore = (m_levelScore + _arg1);
if ((((_arg4 > 1)) && ((_arg5 > 1)))){
throw (new Error("Комбо и клик-комбо не могут быть одновременно!"));
};
dispatchEvent(new ScoreEvent(ON_SCORE_CHANGE, _arg2, _arg1, _arg3, _arg4, _arg5, _local7));
}
public function get levelNumber():int{
return (m_levelNumber);
}
private function get goldTriangleCount():uint{
var _local3:int;
var _local4:Triangle;
var _local1:uint;
var _local2:int;
while (_local2 < m_triangles.length) {
_local3 = 0;
while (_local3 < m_triangles[_local2].length) {
_local4 = m_triangles[_local2][_local3];
if (((_local4) && ((_local4.mode == Triangle.MODE_GOLD)))){
_local1++;
};
_local3++;
};
_local2++;
};
return (_local1);
}
private function onGoldTriangle(_arg1:Event){
dispatchEvent(new Event(Triangle.ON_GOLD_TRIANGLE));
if (goldTriangleCount >= m_trianglesCount){
mode = MODE_COMPLETE;
};
}
private function onTriTimer(_arg1:TimerEvent):void{
var _local3:int;
var _local4:Triangle;
var _local2:int;
while (_local2 < m_triangles.length) {
_local3 = 0;
while (_local3 < m_triangles[_local2].length) {
_local4 = m_triangles[_local2][_local3];
if (((_local4) && (!(contains(_local4))))){
_local4.alpha = 0;
addChild(_local4);
setChildIndex(m_levelNumberText, (numChildren - 1));
_local4.changeAlpha(1, 2000);
_local4.addEventListener(CustomAlphaObject.ON_FINISH_ALPHA_CHANGE, onTriangleLockAppear);
return;
};
_local3++;
};
_local2++;
};
}
private function onTriangleLockAppear(_arg1:Event){
var _local2:Triangle = Triangle(_arg1.target);
_local2.removeEventListener(CustomAlphaObject.ON_FINISH_ALPHA_CHANGE, onTriangleLockAppear);
var _local3:String;
switch (_local2.mode){
case Triangle.MODE_LOCK:
_local3 = ON_TRIANGLE_LOCK_APPEAR;
break;
case Triangle.MODE_DOUBLE_LOCK:
_local3 = ON_TRIANGLE_DOUBLE_LOCK_APPEAR;
break;
case Triangle.MODE_COLOR_LOCK_A:
case Triangle.MODE_COLOR_LOCK_B:
case Triangle.MODE_COLOR_LOCK_C:
case Triangle.MODE_COLOR_LOCK_1:
case Triangle.MODE_COLOR_LOCK_2:
case Triangle.MODE_COLOR_LOCK_3:
case Triangle.MODE_COLOR_LOCK_4:
case Triangle.MODE_COLOR_LOCK_5:
case Triangle.MODE_COLOR_LOCK_6:
case Triangle.MODE_COLOR_LOCK_7:
_local3 = ON_TRIANGLE_COLOR_LOCK_APPEAR;
break;
};
if (_local3 != null){
dispatchEvent(new TooltipEvent(_local3, _local2.localToGlobal(_local2.centerPoint)));
};
}
private function onTriTimerComplete(_arg1:TimerEvent):void{
m_figureTimer.start();
new SoundPlayer(new LevelBegin2Sound());
}
private function onFigureTimer(_arg1:TimerEvent):void{
var _local3:int;
var _local4:FigurePlace;
var _local2:int = (m_figurePlaces.length - 1);
while (_local2 >= 0) {
_local3 = (m_figurePlaces[_local2].length - 1);
while (_local3 >= 0) {
_local4 = m_figurePlaces[_local2][_local3];
if (((_local4) && (_local4.figure))){
if (((!(_local4.figure.moving)) && (!(_local4.point.equals(new Point(_local4.figure.x, _local4.figure.y)))))){
dropObject(_local4.point, _local4.figure, GameSettings.DROP_SPEED);
setChildIndex(m_levelNumberText, (numChildren - 1));
return;
};
};
_local3--;
};
_local2--;
};
}
private function blackFigureCount():uint{
var _local2:Figure;
var _local1:uint;
for each (_local2 in m_figures) {
if (_local2.black){
_local1++;
};
};
return (_local1);
}
private function createFigure(_arg1:FigurePlace){
if (_arg1.figure){
throw (new Error("Ошибка при создании фигуры. Выбранное место уже содержит другую фигуру"));
};
var _local2:Boolean;
var _local3:uint = (Math.floor((Math.random() * 100)) + 1);
if (((m_blackFigureTryCount) || ((_local3 <= (m_levelInfo.blackFigurePercent + 5))))){
if ((((((mode == MODE_LOADING)) && ((m_levelInfo.getFigureInfo(_arg1.index).mode == Chains.MODE_NO_CHAIN)))) || (((!((mode == MODE_LOADING))) && ((_arg1.mode == Chains.MODE_NO_CHAIN)))))){
if ((blackFigureCount() + 1) <= Math.floor(((m_figurePlaceCount * m_levelInfo.blackFigurePercent) / 100))){
_local2 = true;
};
if (m_blackFigureTryCount){
m_blackFigureTryCount--;
};
} else {
m_blackFigureTryCount++;
};
};
_arg1.figure = new Figure(_arg1.point, m_levelInfo.figureColorCount, _local2);
m_figures.push(_arg1.figure);
_arg1.figure.alpha = 0;
_arg1.figure.addEventListener(BasicObject.MOVE_START, OnFigureMoveStart);
_arg1.figure.addEventListener(BasicObject.MOVE_FINISH, OnFigureMoveFinish);
}
private function updateChildIndex(){
var _local2:int;
var _local3:int;
var _local4:Triangle;
var _local5:FigurePlace;
var _local1:uint;
_local2 = 0;
while (_local2 < m_triangles.length) {
_local3 = 0;
while (_local3 < m_triangles[_local2].length) {
_local4 = m_triangles[_local2][_local3];
if (((_local4) && (contains(_local4)))){
setChildIndex(_local4, 1);
};
_local3++;
};
_local2++;
};
_local2 = 0;
while (_local2 < m_figurePlaces.length) {
_local3 = 0;
while (_local3 < m_figurePlaces[_local2].length) {
_local5 = m_figurePlaces[_local2][_local3];
if (((_local5) && (contains(_local5)))){
setChildIndex(_local5, (numChildren - 1));
};
_local3++;
};
_local2++;
};
}
private function dropObject(_arg1:Point, _arg2:BasicObject, _arg3:int):void{
var _local4:Point = new Point(_arg1.x, _arg1.y);
_local4.offset(GameSettings.DROP_OFFSETX, GameSettings.DROP_OFFSETY);
_arg2.x = _local4.x;
_arg2.y = _local4.y;
_arg2.moveToPoint(_arg1, _arg3);
addChild(_arg2);
updateChildIndex();
}
private function destroyFigure(_arg1:FigurePlace):void{
var _local2:int = m_figures.indexOf(_arg1.figure);
if (_local2 < 0){
throw (new Error("Фигура не найдена в массиве созданных ранее фигур"));
};
m_figures.splice(_local2, 1);
_arg1.figure.removeEventListener(BasicObject.MOVE_START, OnFigureMoveStart);
_arg1.figure.removeEventListener(BasicObject.MOVE_FINISH, OnFigureMoveFinish);
_arg1.figure.addEventListener(Figure.DESTROING_FINISH, onFigureDestroingFinish);
_arg1.figure.destroy();
_arg1.figure = null;
}
private function onFigureDestroingFinish(_arg1:Event){
var _local2:Figure = Figure(_arg1.target);
_local2.removeEventListener(Figure.DESTROING_FINISH, onFigureDestroingFinish);
removeChild(_local2);
}
private function upperTrianglesByFigurePlace(_arg1:FigurePlace):Array{
var fp = _arg1;
var push:Function = function (_arg1:Array, _arg2:int, _arg3:int){
if ((((((((((_arg2 >= 0)) && ((_arg2 < m_triangles.length)))) && ((_arg3 >= 0)))) && ((_arg3 < m_triangles[_arg2].length)))) && (m_triangles[_arg2][_arg3]))){
_arg1.push(m_triangles[_arg2][_arg3]);
};
};
var triangles:Array = new Array();
var k:int = ((m_figurePlaces[fp.row].length)==5) ? -1 : 1;
push(triangles, (fp.row - 2), (fp.col * 2));
push(triangles, (fp.row - 2), ((fp.col * 2) + k));
return (triangles);
}
private function leftAndRightTrianglesByFigurePlace(_arg1:FigurePlace):Array{
var fp = _arg1;
var push:Function = function (_arg1:Array, _arg2:int, _arg3:int){
if ((((((((((_arg2 >= 0)) && ((_arg2 < m_triangles.length)))) && ((_arg3 >= 0)))) && ((_arg3 < m_triangles[_arg2].length)))) && (m_triangles[_arg2][_arg3]))){
_arg1.push(m_triangles[_arg2][_arg3]);
};
};
var triangles:Array = new Array();
var k:int = ((m_figurePlaces[fp.row].length)==5) ? -1 : 1;
push(triangles, (fp.row - 1), (fp.col * 2));
push(triangles, (fp.row - 1), ((fp.col * 2) + k));
return (triangles);
}
private function getUpperFigurePlaces(_arg1:FigurePlace):Array{
var _local5:Triangle;
var _local6:Array;
var _local7:int;
var _local2:Array = new Array(null, null, null);
var _local3:Array = upperTrianglesByFigurePlace(_arg1);
var _local4:Array = leftAndRightTrianglesByFigurePlace(_arg1);
if (_local3.length){
_local5 = _local3[0];
_local6 = getFigurePlacesByTriangle(_local5);
_local2[1] = _local6[0];
};
if (_local4.length){
for each (_local5 in _local4) {
_local6 = getFigurePlacesByTriangle(_local5);
_local7 = (_local5.isLeft) ? 2 : 0;
_local2[_local7] = _local6[0];
};
};
return (_local2);
}
private function neighboringFigurePlaces(_arg1:FigurePlace){
var _local4:Triangle;
var _local5:Array;
var _local6:FigurePlace;
var _local2:Array = new Array();
_local2.push(_arg1);
var _local3:Array = trianglesByFigurePlace(_arg1);
for each (_local4 in _local3) {
_local5 = getFigurePlacesByTriangle(_local4);
for each (_local6 in _local5) {
if (_local2.indexOf(_local6) < 0){
_local2.push(_local6);
};
};
};
_local2.shift();
return (_local2);
}
private function trianglesByFigurePlace(_arg1:FigurePlace):Array{
var fp = _arg1;
var push:Function = function (_arg1:Array, _arg2:int, _arg3:int){
if ((((((((((_arg2 >= 0)) && ((_arg2 < m_triangles.length)))) && ((_arg3 >= 0)))) && ((_arg3 < m_triangles[_arg2].length)))) && (m_triangles[_arg2][_arg3]))){
_arg1.push(m_triangles[_arg2][_arg3]);
};
};
var triangles:Array = new Array();
var k:int = ((m_figurePlaces[fp.row].length)==5) ? -1 : 1;
var i:int;
while (i < 3) {
push(triangles, (fp.row - i), (fp.col * 2));
push(triangles, (fp.row - i), ((fp.col * 2) + k));
i = (i + 1);
};
return (triangles);
}
public function haveTriangleByPoint(_arg1:Point):Boolean{
return ((getTriangleByPoint(_arg1)) ? true : false);
}
private function getTriangleByPoint(_arg1:Point):Triangle{
var _local3:int;
var _local4:Triangle;
var _local2:int;
while (_local2 < m_rowCount) {
_local3 = 0;
while (_local3 < m_colCount) {
_local4 = Triangle(m_triangles[_local2][_local3]);
if (((_local4) && (_local4.PointInTriangle(_local4.globalToLocal(_arg1))))){
return (_local4);
};
_local3++;
};
_local2++;
};
return (null);
}
private function getFigurePlacesByTriangle(_arg1:Triangle):Array{
var _local3:int;
var _local4:int;
var _local5:int;
var _local2:Array = new Array(3);
var _local6:int;
var _local7 = 1;
var _local8 = 2;
if ((_arg1.row % 2) == 0){
_local3 = ((_arg1.col + 1) / 2);
_local4 = (_arg1.col / 2);
} else {
_local3 = (_arg1.col / 2);
_local4 = ((_arg1.col + 1) / 2);
};
_local5 = _local3;
if (!_arg1.isLeft){
_local7 = 2;
_local8 = 1;
};
_local2[_local6] = m_figurePlaces[_arg1.row][_local3];
_local2[_local7] = m_figurePlaces[(_arg1.row + 1)][_local4];
_local2[_local8] = m_figurePlaces[(_arg1.row + 2)][_local5];
return (_local2);
}
private function triangleHaveChain(_arg1:Triangle):Boolean{
var _local3:FigurePlace;
var _local2:Array = getFigurePlacesByTriangle(_arg1);
for each (_local3 in _local2) {
if (((_local3.figure) && ((((_local3.mode == Chains.MODE_CHAIN)) || ((_local3.mode == Chains.MODE_DOUBLE_CHAIN)))))){
return (true);
};
};
return (false);
}
private function equalFigurePlaces(_arg1:Array, _arg2:Array):Boolean{
var _local3:FigurePlace;
for each (_local3 in _arg1) {
if (_arg2.indexOf(_local3) < 0){
return (false);
};
};
return (true);
}
private function changeActiveTriangle(_arg1:Triangle){
var _local2:Triangle;
var _local3:Array;
var _local4:FigurePlace;
var _local7:int;
var _local8:Boolean;
var _local5:Array = new Array();
var _local6:int;
while (_local6 < m_figurePlaces.length) {
_local7 = 0;
while (_local7 < m_figurePlaces[_local6].length) {
_local4 = m_figurePlaces[_local6][_local7];
if (((((_local4) && (_local4.figure))) && (_local4.figure.active))){
_local5.push(_local4);
};
_local7++;
};
_local6++;
};
_local6 = 0;
while (_local6 < m_rowCount) {
_local7 = 0;
while (_local7 < m_colCount) {
_local2 = Triangle(m_triangles[_local6][_local7]);
if (_local2){
if (_local2 == _arg1){
switch (mode){
case MODE_NORMAL:
if (triangleHaveChain(_local2)){
_local2.state = Triangle.STATE_DISABLED;
} else {
_local2.state = Triangle.STATE_ACTIVE;
};
break;
case MODE_BOMB:
_local2.state = Triangle.STATE_NORMAL;
break;
};
setChildIndex(_local2, ((1 + m_trianglesCount) - 1));
_local3 = getFigurePlacesByTriangle(_local2);
_local8 = equalFigurePlaces(_local3, _local5);
for each (_local4 in _local3) {
if (_local4.figure){
if (!_local8){
_local4.figure.active = false;
};
_local4.figure.active = true;
if (mode == MODE_BOMB){
_local4.figure.tremble = true;
};
};
};
} else {
_local2.state = Triangle.STATE_NORMAL;
};
};
_local7++;
};
_local6++;
};
_local6 = 0;
while (_local6 < m_figurePlaces.length) {
_local7 = 0;
while (_local7 < m_figurePlaces[_local6].length) {
_local4 = m_figurePlaces[_local6][_local7];
if (((_local4) && (_local4.figure))){
if (((!(_local3)) || (((_local3) && ((_local3.indexOf(_local4) < 0)))))){
_local4.figure.active = false;
_local4.figure.tremble = false;
};
};
_local7++;
};
_local6++;
};
}
private function activateTriangleByPoint(_arg1:Point){
var _local2:Triangle = getTriangleByPoint(_arg1);
changeActiveTriangle(_local2);
}
private function onBombMouseMoveProcess(_arg1:Event){
activateTriangleByPoint(localToGlobal(new Point(mouseX, mouseY)));
}
private function OnMouseMove(_arg1:MouseEvent):void{
if (m_movingFigures.length){
return;
};
activateTriangleByPoint(new Point(_arg1.stageX, _arg1.stageY));
}
private function OnMouseOut(_arg1:MouseEvent):void{
}
private function blowTriangles(_arg1:Array){
var _local2:Triangle;
var _local3:Array;
var _local6:int;
var _local7:FigurePlace;
var _local4:Array = new Array();
var _local5:Array = new Array();
for each (_local2 in _arg1) {
_local2.mode = Triangle.MODE_GOLD;
m_playerMoveScore = getScoreForMatch(3);
m_playerMoveIterate = 1;
m_clickComboCoeff = 1;
addLevelScore(m_playerMoveScore, _local2.localToGlobal(_local2.centerPoint), 3, m_playerMoveIterate, m_clickComboCoeff, getFigurePlacesByTriangle(_local2));
};
for each (_local2 in _arg1) {
_local3 = getFigurePlacesByTriangle(_local2);
for each (_local7 in _local3) {
if (_local4.indexOf(_local7) < 0){
_local7.mode = Chains.MODE_NO_CHAIN;
_local4.push(_local7);
_local5.push(_local7.figure);
destroyFigure(_local7);
};
};
};
if (_arg1.length){
new SoundPlayer(new Burst1Sound());
};
_local6 = getMaxRow(_local4);
while (_local6 > 0) {
startFigureFall(_local6);
_local6--;
};
dropFigures(_local5.length);
}
private function OnBombMouseClick(_arg1:MouseEvent):void{
if (mode != MODE_BOMB){
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
return;
};
var _local2:Triangle = getTriangleByPoint(new Point(_arg1.stageX, _arg1.stageY));
if (_local2){
blowTriangles(new Array(_local2));
if (Game.soundOn){
new Boom1Sound().play();
};
dispatchEvent(new Event(ON_BOMB_USE));
mode = MODE_NORMAL;
};
}
private function OnMouseClick(_arg1:MouseEvent):void{
var _local3:Array;
var _local4:FigurePlace;
var _local5:FigurePlace;
var _local6:FigurePlace;
var _local7:Vect;
var _local8:Vect;
var _local9:Vect;
if (m_movingFigures.length){
return;
};
if (_arg1.ctrlKey){
};
var _local2:Triangle = getTriangleByPoint(new Point(_arg1.stageX, _arg1.stageY));
if (_local2){
_local3 = getFigurePlacesByTriangle(_local2);
_local4 = _local3[0];
_local5 = _local3[1];
_local6 = _local3[2];
if (triangleHaveChain(_local2)){
_local7 = new Vect((_local5.point.x - _local4.point.x), (_local5.point.y - _local4.point.y));
_local7.mulScalar((GameSettings.PULL_OFFSET / _local7.magnitude()));
_local8 = new Vect((_local6.point.x - _local5.point.x), (_local6.point.y - _local5.point.y));
_local8.mulScalar((GameSettings.PULL_OFFSET / _local8.magnitude()));
_local9 = new Vect((_local4.point.x - _local6.point.x), (_local4.point.y - _local6.point.y));
_local9.mulScalar((GameSettings.PULL_OFFSET / _local9.magnitude()));
if (Game.soundOn){
m_rotate_wrong_sound.play();
};
if (_local4.figure){
_local4.figure.pull(new Point((_local4.figure.x + _local7.x), (_local4.figure.y + _local7.y)), GameSettings.ROTATION_SPEED);
};
if (_local5.figure){
_local5.figure.pull(new Point((_local5.figure.x + _local8.x), (_local5.figure.y + _local8.y)), GameSettings.ROTATION_SPEED);
};
if (_local6.figure){
_local6.figure.pull(new Point((_local6.figure.x + _local9.x), (_local6.figure.y + _local9.y)), GameSettings.ROTATION_SPEED);
};
} else {
if (Game.soundOn){
m_rotate_sound.play();
};
if (_local4.figure){
_local4.figure.moveToPoint(new Point(_local5.point.x, _local5.point.y), GameSettings.ROTATION_SPEED);
};
if (_local5.figure){
_local5.figure.moveToPoint(new Point(_local6.point.x, _local6.point.y), GameSettings.ROTATION_SPEED);
};
if (_local6.figure){
_local6.figure.moveToPoint(new Point(_local4.point.x, _local4.point.y), GameSettings.ROTATION_SPEED);
};
m_rotatedTriangle = _local2;
};
};
}
private function figureCount(_arg1:Triangle):int{
var _local4:FigurePlace;
var _local2:Array = getFigurePlacesByTriangle(_arg1);
var _local3:int;
for each (_local4 in _local2) {
if (_local4.figure){
_local3++;
};
};
return (_local3);
}
private function getTriangleFigureColors(_arg1:Triangle):Array{
var _local4:FigurePlace;
var _local2:Array = new Array();
var _local3:Array = getFigurePlacesByTriangle(_arg1);
for each (_local4 in _local3) {
if (_local4.figure){
if (_local2.indexOf(_local4.figure.figureIndex) < 0){
_local2.push(_local4.figure.figureIndex);
};
};
};
return (_local2);
}
private function triangleHaveBlackFigure(_arg1:Triangle){
var _local3:FigurePlace;
var _local2:Array = getFigurePlacesByTriangle(_arg1);
for each (_local3 in _local2) {
if (((_local3.figure) && (_local3.figure.black))){
return (true);
};
};
return (false);
}
function getMaxRow(_arg1:Array){
var _local3:FigurePlace;
var _local2 = -1;
for each (_local3 in _arg1) {
if (_local3.row > _local2){
_local2 = _local3.row;
};
};
return (_local2);
}
function startFigureFall(_arg1:int){
var f:Figure;
var fp:FigurePlace;
var i = _arg1;
var getFigureForPlace:Function = function (_arg1:FigurePlace, _arg2:Array):Figure{
var _local3:Array;
var _local4:FigurePlace;
var _local5:FigurePlace;
var _local6:FigurePlace;
var _local7:Figure;
_local3 = getUpperFigurePlaces(_arg1);
_local4 = _local3[1];
if (_local4){
if (((((_local4.figure) && (!((_local4.mode == Chains.MODE_CHAIN))))) && (!((_local4.mode == Chains.MODE_DOUBLE_CHAIN))))){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local4.figure);
};
if (!_local4.figure){
_local7 = getFigureForPlace(_local4, _arg2);
if (_local7){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local7);
};
};
};
_local4 = _local3[0];
if (((((((_local4) && (_local4.figure))) && (!((_local4.mode == Chains.MODE_CHAIN))))) && (!((_local4.mode == Chains.MODE_DOUBLE_CHAIN))))){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local4.figure);
};
_local4 = _local3[2];
if (((((((_local4) && (_local4.figure))) && (!((_local4.mode == Chains.MODE_CHAIN))))) && (!((_local4.mode == Chains.MODE_DOUBLE_CHAIN))))){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local4.figure);
};
_local4 = _local3[0];
if (((_local4) && (!(_local4.figure)))){
_local7 = getFigureForPlace(_local4, _arg2);
if (_local7){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local7);
};
};
_local4 = _local3[2];
if (((_local4) && (!(_local4.figure)))){
_local7 = getFigureForPlace(_local4, _arg2);
if (_local7){
_arg2.push(new Point(_arg1.point.x, _arg1.point.y));
return (_local7);
};
};
return (null);
};
var points:Array = new Array();
for each (fp in m_figurePlaces[i]) {
if (((!(fp)) || (fp.figure))){
} else {
points.length = 0;
f = getFigureForPlace(fp, points);
if (f){
f.moveToPoints(points, GameSettings.FALL_SPEED);
fp.figure = f;
};
};
};
}
function dropFigures(_arg1:int){
var _local2:FigurePlace;
var _local3:Figure;
var _local4:int;
var _local6:int;
var _local5:int = (m_figurePlaces.length - 1);
while (_local5 >= 0) {
_local6 = 0;
while (_local6 < m_figurePlaces[_local5].length) {
_local2 = m_figurePlaces[_local5][_local6];
if (((_local2) && (!(_local2.figure)))){
++_local4;
if (_local4 > _arg1){
throw (new Error("Кол-во добавленных фигур больше кол-ва удалённых"));
};
createFigure(_local2);
dropObject(_local2.point, _local2.figure, GameSettings.FALL_SPEED);
};
_local6++;
};
_local5--;
};
if (_local4 != _arg1){
throw (new Error("Кол-во добавленных фигур не равно кол-ву удалённых"));
};
}
private function sameFigurePlaces(_arg1:FigurePlace, _arg2:Array):Array{
var fp = _arg1;
var p_figurePlaces = _arg2;
var internalSameFigurePlaces:Function = function (_arg1:Array, _arg2:FigurePlace){
var _local4:FigurePlace;
var _local3:Array = neighboringFigurePlaces(_arg2);
for each (_local4 in _local3) {
if ((((((((_arg1.indexOf(_local4) < 0)) && ((p_figurePlaces.indexOf(_local4) >= 0)))) && (_local4.figure))) && ((_local4.figure.figureIndex == _arg2.figure.figureIndex)))){
_arg1.push(_local4);
internalSameFigurePlaces(_arg1, _local4);
};
};
};
if (!fp.figure){
throw (new Error("ошибка при вызове sameFigurePlaces"));
};
var res:Array = new Array();
internalSameFigurePlaces(res, fp);
return (res);
}
private function getMatches(_arg1:Array):Array{
var _local2:Array;
var _local4:Boolean;
var _local5:FigurePlace;
var _local3:Array = new Array();
for each (_local5 in _arg1) {
_local4 = false;
for each (_local2 in _local3) {
if (_local2.indexOf(_local5) >= 0){
_local4 = true;
break;
};
};
if (!_local4){
_local2 = sameFigurePlaces(_local5, _arg1);
_local3.push(_local2);
};
};
return (_local3);
}
private function getScoreForMatch(_arg1:int){
switch (_arg1){
case 3:
return (GameSettings.MATCH3);
case 4:
return (GameSettings.MATCH4);
case 5:
return (GameSettings.MATCH5);
case 6:
return (GameSettings.MATCH6);
case 7:
return (GameSettings.MATCH7);
case 8:
return (GameSettings.MATCH8);
};
}
private function getMatchCenter(_arg1:Array):Point{
var _local2:FigurePlace = _arg1[0];
var _local3:int = _local2.point.x;
var _local4:int = _local2.point.y;
var _local5:int = _local2.point.x;
var _local6:int = _local2.point.y;
for each (_local2 in _arg1) {
if (_local2.point.x < _local3){
_local3 = _local2.point.x;
};
if (_local2.point.x > _local5){
_local5 = _local2.point.x;
};
if (_local2.point.y < _local4){
_local4 = _local2.point.y;
};
if (_local2.point.y > _local6){
_local6 = _local2.point.y;
};
};
return (new Point((_local3 + ((_local5 - _local3) / 2)), (_local4 + ((_local6 - _local4) / 2))));
}
private function onPlayerMove(_arg1:Array):int{
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:Triangle;
var _local6:FigurePlace;
var _local7:Figure;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:uint;
var _local19:Array;
var _local20:uint;
var _local21:uint;
var _local22:uint;
var _local23:Array;
var _local24:Sound;
var _local8:Array = new Array();
var _local9:Array = new Array();
var _local10:Array = new Array();
var _local11:Array = new Array();
var _local12:Array = new Array();
var _local13:Array = new Array();
for each (_local6 in _arg1) {
_local2 = trianglesByFigurePlace(_local6);
for each (_local5 in _local2) {
if (_local8.indexOf(_local5) < 0){
_local8.push(_local5);
};
};
};
for each (_local5 in _local8) {
if (figureCount(_local5) != 3){
} else {
_local4 = getTriangleFigureColors(_local5);
if (_local4.length != 1){
} else {
if (triangleHaveBlackFigure(_local5)){
} else {
_local14 = _local4[0];
switch (_local5.mode){
case Triangle.MODE_NORMAL:
if (!triangleHaveChain(_local5)){
_local5.mode = Triangle.MODE_GOLD;
_local9.push(_local5);
};
_local10.push(_local5);
break;
case Triangle.MODE_LOCK:
_local5.mode = Triangle.MODE_NORMAL;
_local10.push(_local5);
break;
case Triangle.MODE_DOUBLE_LOCK:
_local5.mode = Triangle.MODE_LOCK;
_local10.push(_local5);
break;
case Triangle.MODE_GOLD:
_local10.push(_local5);
break;
case Triangle.MODE_COLOR_LOCK_1:
case Triangle.MODE_COLOR_LOCK_2:
case Triangle.MODE_COLOR_LOCK_3:
case Triangle.MODE_COLOR_LOCK_4:
case Triangle.MODE_COLOR_LOCK_5:
case Triangle.MODE_COLOR_LOCK_6:
case Triangle.MODE_COLOR_LOCK_7:
_local10.push(_local5);
if (((_local4[0] - 1) + Triangle.MODE_COLOR_LOCK_1) == _local5.mode){
_local5.mode = Triangle.MODE_NORMAL;
};
break;
};
};
};
};
};
if (!_local10.length){
return (0);
};
for each (_local5 in _local10) {
_local3 = getFigurePlacesByTriangle(_local5);
for each (_local6 in _local3) {
if (_local13.indexOf(_local6) < 0){
_local13.push(_local6);
};
if (_local11.indexOf(_local6) < 0){
if (_local6.mode == Chains.MODE_CHAIN){
_local6.mode = Chains.MODE_NO_CHAIN;
} else {
if (_local6.mode == Chains.MODE_DOUBLE_CHAIN){
_local6.mode = Chains.MODE_CHAIN;
} else {
_local11.push(_local6);
_local12.push(_local6);
};
};
};
};
};
_local17 = 0;
_local19 = getMatches(_local13);
_local20 = m_clickComboCoeff;
_local21 = m_playerMoveIterate;
for each (_local23 in _local19) {
if (m_playerMoveIterate == 1){
_local21 = 1;
} else {
_local20 = 1;
};
_local22 = getScoreForMatch(_local23.length);
_local18 = ((_local22 * _local21) * _local20);
_local17 = (_local17 + _local18);
addLevelScore(_local18, localToGlobal(getMatchCenter(_local23)), _local23.length, _local21, _local20, _local23);
};
for each (_local6 in _local12) {
destroyFigure(_local6);
};
switch (Math.max(_local21, _local21)){
case 1:
_local24 = new Burst2Sound();
break;
case 2:
_local24 = new Burst2Sound();
break;
case 3:
_local24 = new Burst3Sound();
break;
case 4:
_local24 = new Burst4Sound();
break;
default:
_local24 = new Burst5Sound();
break;
};
new SoundPlayer(_local24);
_local15 = getMaxRow(_local11);
while (_local15 > 0) {
startFigureFall(_local15);
_local15--;
};
dropFigures(_local12.length);
return (_local17);
}
private function findFigurePlace(_arg1:Point):FigurePlace{
var _local2:FigurePlace;
var _local4:int;
var _local3:int;
while (_local3 < m_figurePlaces.length) {
_local4 = 0;
while (_local4 < m_figurePlaces[_local3].length) {
_local2 = m_figurePlaces[_local3][_local4];
if (((_local2) && (_local2.point.equals(_arg1)))){
return (_local2);
};
_local4++;
};
_local3++;
};
return (null);
}
private function OnFigureMoveStart(_arg1:MoveEvent){
if ((((m_movingFigures.length == 0)) && (!((mode == MODE_LOADING))))){
dispatchEvent(new Event(ON_PLAYER_MOVE_START));
};
var _local2:Figure = Figure(_arg1.currentTarget);
if (m_movingFigures.indexOf(_local2) < 0){
m_movingFigures.push(_local2);
};
var _local3:FigurePlace = findFigurePlace(_arg1.startPoint);
if (_local3){
_local3.figure = null;
};
changeActiveTriangle(null);
}
private function OnFigureMoveFinish(_arg1:MoveEvent){
var _local5:int;
var _local2:Figure = Figure(_arg1.currentTarget);
var _local3:int = m_movingFigures.indexOf(_local2);
if (_local3 < 0){
throw (new Error("В списке летящих фигур прилетевшая фигура не найдена"));
};
m_movingFigures.splice(_local3, 1);
if ((((m_movingFigures.length == 0)) && (!((mode == MODE_LOADING))))){
dispatchEvent(new Event(ON_PLAYER_MOVE_END));
};
var _local4:FigurePlace = findFigurePlace(_arg1.stopPoint);
if (_local4){
if (((_local4.figure) && (!((_local4.figure == _local2))))){
throw (new Error("На одном месте находятся 2 фигуры"));
};
_local4.figure = _local2;
if (mode == MODE_LOADING){
_local4.mode = m_levelInfo.getFigureInfo(_local4.index).mode;
if (_local2.black){
dispatchEvent(new TooltipEvent(ON_BLACK_FIGURE_APPEAR, localToGlobal(_local4.point)));
};
switch (_local4.mode){
case Chains.MODE_CHAIN:
dispatchEvent(new TooltipEvent(ON_FIGURE_CHAIN_APPEAR, localToGlobal(_local4.point)));
break;
case Chains.MODE_DOUBLE_CHAIN:
dispatchEvent(new TooltipEvent(ON_FIGURE_DOUBLE_CHAIN_APPEAR, localToGlobal(_local4.point)));
break;
};
};
m_movedfpSet.push(_local4);
};
if (m_movingFigures.length == 0){
if (mode == MODE_LOADING){
mode = MODE_NORMAL;
};
if (m_rotatedTriangle){
m_playerMoveScore = 0;
m_playerMoveIterate = 1;
} else {
m_playerMoveIterate++;
};
_local5 = onPlayerMove(m_movedfpSet);
if (_local5){
m_playerMoveScore = (m_playerMoveScore + _local5);
};
m_rotatedTriangle = null;
m_movedfpSet.length = 0;
if (m_movingFigures.length == 0){
m_playerMoveIterate = 0;
if (m_playerMoveScore){
m_clickComboCoeff++;
} else {
m_clickComboCoeff = 1;
};
activateTriangleByPoint(localToGlobal(new Point(mouseX, mouseY)));
};
};
}
public function shuffle(){
var _local2:FigurePlace;
var _local3:FigurePlace;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local8:int;
var _local9:int;
var _local10:int;
if ((((mode == MODE_LOADING)) || (m_movingFigures.length))){
return;
};
m_clickComboCoeff = 1;
var _local1:Array = new Array();
var _local7:int;
while (_local7 < m_figurePlaces.length) {
_local8 = 0;
while (_local8 < m_figurePlaces[_local7].length) {
_local2 = m_figurePlaces[_local7][_local8];
if (((((_local2) && (!((_local2.mode == Chains.MODE_CHAIN))))) && (!((_local2.mode == Chains.MODE_DOUBLE_CHAIN))))){
_local5++;
};
_local8++;
};
_local7++;
};
_local7 = 0;
while (_local7 < m_figurePlaces.length) {
_local8 = 0;
while (_local8 < m_figurePlaces[_local7].length) {
_local2 = m_figurePlaces[_local7][_local8];
if (((((_local2) && (!((_local2.mode == Chains.MODE_CHAIN))))) && (!((_local2.mode == Chains.MODE_DOUBLE_CHAIN))))){
_local4 = (Math.floor((Math.random() * ((_local5 - _local1.length) - 1))) + 1);
_local6 = 0;
_local9 = 0;
while (_local9 < m_figurePlaces.length) {
_local10 = 0;
while (_local10 < m_figurePlaces[_local9].length) {
_local3 = m_figurePlaces[_local9][_local10];
if (((((((((_local3) && (!((_local3 == _local2))))) && ((_local1.indexOf(_local3) < 0)))) && (!((_local3.mode == Chains.MODE_CHAIN))))) && (!((_local3.mode == Chains.MODE_DOUBLE_CHAIN))))){
++_local6;
if (_local6 == _local4){
break;
};
};
_local3 = null;
_local10++;
};
if (_local6 == _local4){
break;
};
_local9++;
};
if (((_local3) && (_local2.figure))){
_local1.push(_local3);
_local2.figure.moveToPoint(_local3.point, GameSettings.SHUFFLE_SPEED);
};
};
_local8++;
};
_local7++;
};
}
public function getMode():int{
return (m_mode);
}
private function get mode():int{
return (m_mode);
}
private function doOnLoadComplete(){
removeChild(m_levelNumberText);
m_levelNumberText = null;
updateChildIndex();
dispatchEvent(new Event(PlayingField.LOAD_COMPLETE));
}
private function set mode(_arg1:int){
if (m_mode == _arg1){
return;
};
if (m_mode == MODE_COMPLETE){
return;
};
if (m_mode == MODE_LOADING){
doOnLoadComplete();
};
m_mode = _arg1;
removeEventListener(MouseEvent.CLICK, OnMouseClick);
removeEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
removeEventListener(MouseEvent.CLICK, OnBombMouseClick);
removeEventListener(Event.ENTER_FRAME, onBombMouseMoveProcess);
removeEventListener(Event.ENTER_FRAME, waitForLevelComplete);
switch (m_mode){
case MODE_NORMAL:
addEventListener(MouseEvent.MOUSE_MOVE, OnMouseMove);
addEventListener(MouseEvent.CLICK, OnMouseClick);
break;
case MODE_BOMB:
addEventListener(MouseEvent.CLICK, OnBombMouseClick);
addEventListener(Event.ENTER_FRAME, onBombMouseMoveProcess);
break;
case MODE_COMPLETE:
addEventListener(Event.ENTER_FRAME, waitForLevelComplete);
break;
};
dispatchEvent(new Event(ON_MODE_CHANGE));
}
private function waitForLevelComplete(_arg1:Event){
if (m_movingFigures.length == 0){
removeEventListener(Event.ENTER_FRAME, waitForLevelComplete);
dispatchEvent(new Event(LEVEL_COMPLETE));
};
}
public function bomb(){
mode = MODE_BOMB;
}
public function cancelBomb(){
if (mode == MODE_BOMB){
mode = MODE_NORMAL;
};
}
public function getRandomPoints():Array{
var _local5:int;
var _local6:Triangle;
var _local1:Array = new Array();
var _local2:Array = new Array();
var _local3:uint;
var _local4:int;
while (_local4 < m_triangles.length) {
_local5 = 0;
while (_local5 < m_triangles[_local4].length) {
_local6 = m_triangles[_local4][_local5];
if (((_local6) && (!((_local6.mode == Triangle.MODE_GOLD))))){
_local2.push(_local6);
};
_local5++;
};
_local4++;
};
while ((((++_local3 <= 3)) && (_local2.length))) {
_local4 = Math.floor((Math.random() * _local2.length));
_local6 = _local2[_local4];
_local2.splice(_local4, 1);
_local1.push(_local6.localToGlobal(_local6.centerPoint));
};
return (_local1);
}
public function lightning(_arg1:Point){
var _local2:Triangle = getTriangleByPoint(_arg1);
if (_local2){
_local2.mode = Triangle.MODE_GOLD;
};
}
public function lightnings(_arg1:Array){
var _local3:Point;
var _local4:Triangle;
var _local2:Array = new Array();
for each (_local3 in _arg1) {
_local4 = getTriangleByPoint(_local3);
if (_local4){
_local2.push(_local4);
};
};
if (_local2.length){
blowTriangles(_local2);
};
}
public function get levelScore():uint{
return (m_levelScore);
}
public function gamePause(){
if (((m_figureTimer) && (m_figureTimer.running))){
m_figureTimer.stop();
m_timers.push(m_figureTimer);
};
if (((m_triTimer) && (m_triTimer.running))){
m_triTimer.stop();
m_timers.push(m_triTimer);
};
}
public function gameContinue(){
var _local1:Timer;
for each (_local1 in m_timers) {
_local1.start();
};
m_timers.length = 0;
}
public function isPlayerMove():Boolean{
return ((m_movingFigures.length > 0));
}
}
}//package main
Section 102 (1.43 KiB) ●
//preloader (main.preloader)
package main {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class preloader extends MovieClip {
public var txt:TextField;
public var m_moreGamesBtn:SimpleButton;
public var progressbar:MovieClip;
public static const LOAD_COMPLETE = "loadComplete";
public function preloader(){
m_moreGamesBtn.addEventListener(MouseEvent.CLICK, onMoreGamesBtnClick);
addEventListener(Event.ENTER_FRAME, Update);
}
public function Update(_arg1:Event):void{
var _local2:Number = stage.loaderInfo.bytesLoaded;
var _local3:Number = stage.loaderInfo.bytesTotal;
var _local4 = "";
var _local5:Number = 0;
if (_local3 > 0){
_local5 = Math.floor(((_local2 / _local3) * 100));
_local4 = (((((_local5 + "% (") + Math.round((_local2 / 0x0400))) + "kb / ") + Math.round((_local3 / 0x0400))) + "kb)");
};
this.txt.text = ("Loading... " + _local4);
this.progressbar.gotoAndStop((_local5 + 1));
if ((((_local2 == _local3)) || ((_local3 == 0)))){
removeEventListener(Event.ENTER_FRAME, Update);
dispatchEvent(new Event(LOAD_COMPLETE));
};
}
private function onMoreGamesBtnClick(_arg1:Event){
var e = _arg1;
var request:URLRequest = new URLRequest("http://www.playonlinepuzzles.com/?from=AngkorQuest");
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package main
Section 103 (142 B)
//RotateSound (main.RotateSound)
package main {
import flash.media.*;
public dynamic class RotateSound extends Sound {
}
}//package main
Section 104 (157 B)
//RotateWrongSound (main.RotateWrongSound)
package main {
import flash.media.*;
public dynamic class RotateWrongSound extends Sound {
}
}//package main
Section 105 (157 B)
//RunningTimeSound (main.RunningTimeSound)
package main {
import flash.media.*;
public dynamic class RunningTimeSound extends Sound {
}
}//package main
Section 106 (1.15 KiB) ●
//ScoreEvent (main.ScoreEvent)
package main {
import flash.events.*;
import flash.geom.*;
public class ScoreEvent extends Event {
private var m_score:uint;
private var m_match:uint;
private var m_combo:uint;
private var m_clickCombo:uint;
private var m_point:Point;
private var m_points:Array;
public function ScoreEvent(_arg1:String, _arg2:Point, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:Array, _arg8:Boolean=false, _arg9:Boolean=false){
var _local10:Point;
super(_arg1, _arg8, _arg9);
m_points = new Array();
for each (_local10 in _arg7) {
m_points.push(new Point(_local10.x, _local10.y));
};
m_score = _arg3;
m_match = _arg4;
m_combo = _arg5;
m_clickCombo = _arg6;
m_point = _arg2;
}
public function get score():uint{
return (m_score);
}
public function get point():Point{
return (new Point(m_point.x, m_point.y));
}
public function get match():uint{
return (m_match);
}
public function get combo():uint{
return (m_combo);
}
public function get clickCombo():uint{
return (m_clickCombo);
}
public function get points():Array{
return (m_points);
}
}
}//package main
Section 107 (148 B)
//Shuffle1Sound (main.Shuffle1Sound)
package main {
import flash.media.*;
public dynamic class Shuffle1Sound extends Sound {
}
}//package main
Section 108 (547 B)
//ShuffleButton (main.ShuffleButton)
package main {
import flash.display.*;
public class ShuffleButton extends MyButton {
override protected function createAnimation(_arg1:int):MovieClip{
switch (_arg1){
case MyButton.MODE_NORMAL:
return (new ShuffleMovieNormal());
case MyButton.MODE_OVER:
return (new ShuffleMovieOver());
case MyButton.MODE_PRESSED:
return (new ShuffleMoviePressed());
case MyButton.MODE_DISABLED:
return (new ShuffleMovieDisabled());
};
return (null);
}
}
}//package main
Section 109 (252 B)
//ShuffleButtonFilling (main.ShuffleButtonFilling)
package main {
public class ShuffleButtonFilling extends ButtonFilling {
override protected function internalSetPersent(_arg1:Number){
m_percent = Math.min(_arg1, 100);
}
}
}//package main
Section 110 (175 B)
//ShuffleMovieDisabled (main.ShuffleMovieDisabled)
package main {
import flash.display.*;
public dynamic class ShuffleMovieDisabled extends MovieClip {
}
}//package main
Section 111 (169 B)
//ShuffleMovieNormal (main.ShuffleMovieNormal)
package main {
import flash.display.*;
public dynamic class ShuffleMovieNormal extends MovieClip {
}
}//package main
Section 112 (163 B)
//ShuffleMovieOver (main.ShuffleMovieOver)
package main {
import flash.display.*;
public dynamic class ShuffleMovieOver extends MovieClip {
}
}//package main
Section 113 (172 B)
//ShuffleMoviePressed (main.ShuffleMoviePressed)
package main {
import flash.display.*;
public dynamic class ShuffleMoviePressed extends MovieClip {
}
}//package main
Section 114 (157 B)
//SoundContainer (main.SoundContainer)
package main {
import flash.display.*;
public dynamic class SoundContainer extends MovieClip {
}
}//package main
Section 115 (368 B)
//SoundPlayer (main.SoundPlayer)
package main {
import flash.media.*;
public class SoundPlayer {
private var m_soundChannel:SoundChannel;// = null
public function SoundPlayer(_arg1:Sound){
if (Game.soundOn){
m_soundChannel = _arg1.play();
};
}
public function get soundChannel():SoundChannel{
return (m_soundChannel);
}
}
}//package main
Section 116 (730 B)
//Star (main.Star)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Star extends BasicObject {
private var m_percent:uint;
public function Star(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Point, _arg4:Number, _arg5:uint){
m_percent = _arg5;
x = _arg2.x;
y = _arg2.y;
if (_arg1){
_arg1.addChild(this);
};
addEventListener(BasicObject.MOVE_FINISH, onMoveFinish);
moveToPoint(_arg3, _arg4);
}
public function get percent():uint{
return (m_percent);
}
private function onMoveFinish(_arg1:Event){
removeEventListener(BasicObject.MOVE_FINISH, onMoveFinish);
if (parent){
parent.removeChild(this);
};
}
}
}//package main
Section 117 (1.63 KiB) ●
//Starter (main.Starter)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.net.*;
import flash.ui.*;
public class Starter extends MovieClip {
private var m_cursorMov:Cursor;
public function Starter(){
var _local3:MainMenuWindow;
super();
m_cursorMov = new Cursor();
addChild(m_cursorMov);
hideMouseCursor();
m_cursorMov.startDrag();
var _local1:ContextMenuItem = new ContextMenuItem("Download advanced version");
_local1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, cmi_menuItemSelect);
var _local2:ContextMenu = new ContextMenu();
_local2.customItems.push(_local1);
_local2.hideBuiltInItems();
contextMenu = _local2;
_local3 = new MainMenuWindow(m_cursorMov);
_local3.x = (stage.stageWidth / 2);
_local3.y = (stage.stageHeight / 2);
_local3.x = 320;
_local3.y = 300;
addChildAt(_local3, 0);
addEventListener(MouseEvent.CLICK, doOnMouseClick);
addEventListener(MouseEvent.MOUSE_UP, doOnMouseClick);
addEventListener(MouseEvent.MOUSE_OVER, doOnMouseClick);
}
private function hideMouseCursor(){
var _local1:Point = globalToLocal(new Point(mouseX, mouseY));
m_cursorMov.x = (_local1.x + 1);
m_cursorMov.y = _local1.y;
Mouse.hide();
}
private function doOnMouseClick(_arg1:Event){
hideMouseCursor();
}
private function cmi_menuItemSelect(_arg1:ContextMenuEvent):void{
var evt = _arg1;
var url:String = GameSettings.DOWNLOAD_URL;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, "_blank");
} catch(e:Error) {
trace("Error occurred!");
};
}
}
}//package main
Section 118 (1.12 KiB) ●
//SureWindow (main.SureWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
public class SureWindow extends MyWindow {
public var m_OKBtn:SimpleButton;
public var m_text:TextField;
public var m_cancelBtn:SimpleButton;
private var m_action:uint;// = 0
public static const ACTION_NONE = 0;
public static const ACTION_OK = 1;
public static const ACTION_CANCEL = 2;
public function SureWindow(_arg1:Point, _arg2:String){
super(_arg1, false);
m_text.text = _arg2;
m_OKBtn.addEventListener(MouseEvent.CLICK, onOkBtnClick);
m_cancelBtn.addEventListener(MouseEvent.CLICK, onCancelBtnClick);
}
public function get action():uint{
return (m_action);
}
private function onOkBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_OK;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onCancelBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_CANCEL;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
}
}//package main
Section 119 (145 B)
//TimeOutSound (main.TimeOutSound)
package main {
import flash.media.*;
public dynamic class TimeOutSound extends Sound {
}
}//package main
Section 120 (2.11 KiB) ●
//TimeOutWindow (main.TimeOutWindow)
package main {
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.display.*;
import flash.net.*;
public class TimeOutWindow extends MyWindow {
public var m_submitScoreButton:SimpleButton;
public var txtName:TextField;
public var m_submitScoreText:TextField;
public var m_playBtn:SimpleButton;
public var m_mainMenuButton:SimpleButton;
private var m_action:uint;// = 0
private var m_FirstEditClick;// = true
public static const ACTION_NONE = 0;
public static const ACTION_MAIN_MENU = 1;
public static const ACTION_PLAY = 2;
public function TimeOutWindow(_arg1:Point){
super(_arg1, false);
m_mainMenuButton.addEventListener(MouseEvent.CLICK, onMainMenuBtnClick);
m_playBtn.addEventListener(MouseEvent.CLICK, onPlayBtnClick);
m_submitScoreButton.addEventListener(MouseEvent.CLICK, onSubmitBtnClick);
m_submitScoreText.text = String(Game.getScore);
this.txtName.addEventListener(MouseEvent.CLICK, onEditNameClick);
}
public function get action():uint{
return (m_action);
}
private function onMainMenuBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_MAIN_MENU;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onPlayBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
m_action = ACTION_PLAY;
dispatchEvent(new Event(MyWindow.ON_CLOSE));
}
private function onSubmitBtnClick(_arg1:Event):void{
if (Game.soundOn){
new Button1Sound().play();
};
trace("score=", Game.getScore);
navigateToURL(new URLRequest(((((("http://www.playonlinepuzzles.com/score.php?&gameid=angkorquest&score=" + Game.getScore) + "&name=") + this.txtName.text) + "&key=") + (((Game.getScore * Game.getScore) + (5 * Game.getScore)) + 34).toString())), "_blank");
m_submitScoreButton.removeEventListener(MouseEvent.CLICK, onSubmitBtnClick);
}
private function onEditNameClick(_arg1:Event):void{
if (m_FirstEditClick){
this.txtName.text = "";
};
m_FirstEditClick = false;
}
}
}//package main
Section 121 (145 B)
//TipPointer (main.TipPointer)
package main {
import flash.display.*;
public dynamic class TipPointer extends MovieClip {
}
}//package main
Section 122 (431 B)
//TooltipEvent (main.TooltipEvent)
package main {
import flash.events.*;
import flash.geom.*;
public class TooltipEvent extends Event {
private var m_point:Point;
public function TooltipEvent(_arg1:String, _arg2:Point, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
m_point = new Point(_arg2.x, _arg2.y);
}
public function get point():Point{
return (m_point);
}
}
}//package main
Section 123 (475 B)
//TooltipEventInfo (main.TooltipEventInfo)
package main {
import flash.geom.*;
public class TooltipEventInfo {
private var m_tooltip:uint;
private var m_point:Point;
public function TooltipEventInfo(_arg1:uint, _arg2:Point){
m_tooltip = _arg1;
m_point = new Point(_arg2.x, _arg2.y);
}
public function get tooltip():uint{
return (m_tooltip);
}
public function get point():Point{
return (new Point(m_point.x, m_point.y));
}
}
}//package main
Section 124 (3.04 KiB) ●
//TooltipWindow (main.TooltipWindow)
package main {
import flash.geom.*;
import flash.text.*;
import flash.display.*;
public class TooltipWindow extends MyWindow {
public var bg:MovieClip;
public var m_tipWindowMov:MovieClip;
public function TooltipWindow(_arg1:Point, _arg2:Point, _arg3:uint, _arg4:Point, _arg5:Point){
var _local16:Point;
var _local17:*;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
super(_arg1);
gotoAndStop(_arg3);
var _local6:int = (width / 2);
var _local7:int = (height / 2);
var _local8:Point = new Point((_arg2.x - _arg1.x), (_arg2.y - _arg1.y));
var _local9:Vect = new Vect((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
_local9.mulScalar((GameSettings.TIP_POINTER_START / _local9.magnitude()));
var _local10:Point = new Point((_local8.x + _local9.x), (_local8.y + _local9.y));
var _local11:* = new MyTipPointer(_local10, _local8);
addChild(_local11);
_local9.setMembers((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
var _local12:uint = GameSettings.TIP_WINDOW_START;
_local9.mulScalar((_local12 / _local9.magnitude()));
var _local13:Point = new Point((_arg2.x + _local9.x), (_arg2.y + _local9.y));
var _local14:Point = new Point(_arg1.x, _arg1.y);
var _local15:Point = new Point(_arg1.x, _arg1.y);
if (((pointInWindow(_local14, _local13)) || (pointInWindow(_local14, _arg2)))){
do {
_local18 = ((_local9.y > 0)) ? 5 : -5;
_local17 = ((_local9.x > 0)) ? 5 : -5;
_local14.offset(_local17, _local18);
_local19 = ((_local14.x + _local6) - _arg5.x);
_local20 = ((_local14.y + _local7) - _arg5.y);
_local21 = (_arg4.x - (_local14.x - _local6));
_local22 = (_arg4.y - (_local14.y - _local7));
if (_local19 > 0){
_local14.offset(-(_local19), 0);
};
if (_local20 > 0){
_local14.offset(0, -(_local20));
};
if (_local21 > 0){
_local14.offset(_local21, 0);
};
if (_local22 > 0){
_local14.offset(0, _local22);
};
} while (!(_local14.equals(_local15)));
} else {
do {
_local9.setMembers((_local14.x - _arg2.x), (_local14.y - _arg2.y));
_local12 = (_local9.magnitude() - 10);
_local9.mulScalar((_local12 / _local9.magnitude()));
_local14.x = (_arg2.x + _local9.x);
_local14.y = (_arg2.y + _local9.y);
} while (!(pointInWindow(_local14, _local13)));
};
_local16 = localToGlobal(new Point(0, 0));
x = _local14.x;
y = _local14.y;
_local16 = globalToLocal(_local16);
_local11.x = _local16.x;
_local11.y = _local16.y;
}
private function pointInWindow(_arg1:Point, _arg2:Point):Boolean{
var _local3:Point = _arg1.subtract(new Point((m_tipWindowMov.width / 2), (m_tipWindowMov.height / 2)));
var _local4:Point = _arg1.add(new Point((m_tipWindowMov.width / 2), (m_tipWindowMov.height / 2)));
return ((((((((_arg2.x >= _local3.x)) && ((_arg2.x <= _local4.x)))) && ((_arg2.y >= _local3.y)))) && ((_arg2.y <= _local4.y))));
}
}
}//package main
Section 125 (6.77 KiB) ● ●
//Triangle (main.Triangle)
package main {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.filters.*;
public class Triangle extends AlphaObject {
public var m_ActiveTriangleRight:MovieClip;
public var m_LocksRight:Locks;
public var m_GoldTriangleRight:MovieClip;
public var m_GoldTriangleLeft:MovieClip;
public var m_ActiveTriangleLeft:MovieClip;
public var m_LocksLeft:Locks;
private var m_vertexSet:Array;
private var m_ActiveTriangle:MovieClip;
private var m_LockTriangle:Locks;
private var m_GoldTriangle:MovieClip;
private var m_state:int;// = 0
private var m_filter:BitmapFilter;
private var m_row:int;
private var m_col:int;
private var m_isLeft:Boolean;
private var m_mode:int;// = -1
public static const ON_GOLD_TRIANGLE = "onGoldtriangle";
public static const MODE_NORMAL = 1;
public static const MODE_LOCK = 2;
public static const MODE_DOUBLE_LOCK = 3;
public static const MODE_COLOR_LOCK_A = 4;
public static const MODE_COLOR_LOCK_B = 5;
public static const MODE_COLOR_LOCK_C = 6;
public static const MODE_COLOR_LOCK_1 = 7;
public static const MODE_COLOR_LOCK_2 = 8;
public static const MODE_COLOR_LOCK_3 = 9;
public static const MODE_COLOR_LOCK_4 = 10;
public static const MODE_COLOR_LOCK_5 = 11;
public static const MODE_COLOR_LOCK_6 = 12;
public static const MODE_COLOR_LOCK_7 = 13;
public static const MODE_GOLD = 14;
public static const STATE_NORMAL = 0;
public static const STATE_ACTIVE = 1;
public static const STATE_DISABLED = 2;
private static var m_triHeight = 74;
private static var m_triWidth = 64;
public function Triangle(_arg1:Point, _arg2:Boolean, _arg3:int, _arg4:int, _arg5:int=1){
x = _arg1.x;
y = _arg1.y;
m_isLeft = _arg2;
m_vertexSet = new Array(3);
if (_arg2){
m_vertexSet[0] = new Point((triWidth / 2), (-(triHeight) / 2));
m_vertexSet[1] = new Point((-(triWidth) / 2), 0);
m_vertexSet[2] = new Point((triWidth / 2), (triHeight / 2));
} else {
m_vertexSet[0] = new Point((-(triWidth) / 2), (-(triHeight) / 2));
m_vertexSet[1] = new Point((-(triWidth) / 2), (triHeight / 2));
m_vertexSet[2] = new Point((triWidth / 2), 0);
};
m_filter = new GlowFilter(16715824, 0.8, 6, 6, 2, 3, false, false);
m_row = _arg3;
m_col = _arg4;
mode = _arg5;
}
public function UpdateMode(_arg1:Event):void{
if (m_isLeft){
m_ActiveTriangle = m_ActiveTriangleLeft;
m_LockTriangle = m_LocksLeft;
m_GoldTriangle = m_GoldTriangleLeft;
} else {
m_ActiveTriangle = m_ActiveTriangleRight;
m_LockTriangle = m_LocksRight;
m_GoldTriangle = m_GoldTriangleRight;
};
if (((!(m_GoldTriangle)) || (!(m_LockTriangle)))){
return;
};
m_GoldTriangle.gotoAndStop(1);
m_GoldTriangle.visible = false;
m_LockTriangle.gotoAndStop(1);
state = m_state;
switch (m_mode){
case Triangle.MODE_NORMAL:
case Triangle.MODE_LOCK:
case Triangle.MODE_DOUBLE_LOCK:
case Triangle.MODE_COLOR_LOCK_1:
case Triangle.MODE_COLOR_LOCK_2:
case Triangle.MODE_COLOR_LOCK_3:
case Triangle.MODE_COLOR_LOCK_4:
case Triangle.MODE_COLOR_LOCK_5:
case Triangle.MODE_COLOR_LOCK_6:
case Triangle.MODE_COLOR_LOCK_7:
m_LockTriangle.mode = m_mode;
break;
case Triangle.MODE_GOLD:
if (m_LockTriangle.mode == Locks.MODE_NO_LOCK){
m_GoldTriangle.visible = true;
m_GoldTriangle.play();
addEventListener(Event.ENTER_FRAME, onGoldTrianglePlaying);
} else {
m_LockTriangle.addEventListener(ObjectManager.AFTER_MODE_UPDATE, AfterLockDestroy);
m_LockTriangle.mode = Locks.MODE_NO_LOCK;
};
break;
};
removeEventListener(Event.ENTER_FRAME, UpdateMode);
}
private function AfterLockDestroy(_arg1:Event){
var _local2:Locks = (_arg1.target as Locks);
_local2.removeEventListener(ObjectManager.AFTER_MODE_UPDATE, AfterLockDestroy);
m_GoldTriangle.visible = true;
m_GoldTriangle.play();
addEventListener(Event.ENTER_FRAME, onGoldTrianglePlaying);
}
private function onGoldTrianglePlaying(_arg1:Event):void{
if (((!(m_GoldTriangle)) || (((m_GoldTriangle) && ((m_GoldTriangle.currentFrame == m_GoldTriangle.totalFrames)))))){
removeEventListener(Event.ENTER_FRAME, onGoldTrianglePlaying);
if (m_GoldTriangle){
m_GoldTriangle.stop();
dispatchEvent(new Event(ON_GOLD_TRIANGLE));
};
};
}
public function get mode():int{
return (m_mode);
}
public function set mode(_arg1){
var _local2:int;
if (m_mode == _arg1){
return;
};
m_mode = _arg1;
if (m_isLeft){
_local2 = 1;
} else {
_local2 = 2;
};
gotoAndStop(_local2);
addEventListener(Event.ENTER_FRAME, UpdateMode);
}
public function get isLeft():Boolean{
return (m_isLeft);
}
public function getVertex(_arg1:int):Point{
return (new Point(m_vertexSet[_arg1].x, m_vertexSet[_arg1].y));
}
public function get row(){
return (m_row);
}
public function get col(){
return (m_col);
}
public function get state():int{
return (m_state);
}
public function set state(_arg1:int){
m_state = _arg1;
switch (m_state){
case Triangle.STATE_NORMAL:
filters = null;
hideActiveTriangle();
break;
case Triangle.STATE_ACTIVE:
filters = null;
showActiveTriangle();
break;
case Triangle.STATE_DISABLED:
filters = new Array(m_filter);
hideActiveTriangle();
break;
};
}
public function PointInTriangle(_arg1:Point):Boolean{
var _local2:int = (((m_vertexSet[1].y - m_vertexSet[0].y) * (_arg1.x - m_vertexSet[0].x)) - ((m_vertexSet[1].x - m_vertexSet[0].x) * (_arg1.y - m_vertexSet[0].y)));
var _local3:int = (((m_vertexSet[2].y - m_vertexSet[1].y) * (_arg1.x - m_vertexSet[1].x)) - ((m_vertexSet[2].x - m_vertexSet[1].x) * (_arg1.y - m_vertexSet[1].y)));
var _local4:int = (((m_vertexSet[0].y - m_vertexSet[2].y) * (_arg1.x - m_vertexSet[2].x)) - ((m_vertexSet[0].x - m_vertexSet[2].x) * (_arg1.y - m_vertexSet[2].y)));
return ((((((((_local2 > 0)) && ((_local3 > 0)))) && ((_local4 > 0)))) || ((((((_local2 < 0)) && ((_local3 < 0)))) && ((_local4 < 0))))));
}
private function showActiveTriangle(){
if (!m_ActiveTriangle){
return;
};
m_ActiveTriangle.visible = true;
m_ActiveTriangle.play();
}
private function hideActiveTriangle(){
if (!m_ActiveTriangle){
return;
};
m_ActiveTriangle.visible = false;
m_ActiveTriangle.gotoAndStop(1);
}
public function get centerPoint():Point{
return (new Point((((m_vertexSet[0].x + m_vertexSet[1].x) + m_vertexSet[2].x) / 3), (((m_vertexSet[0].y + m_vertexSet[1].y) + m_vertexSet[2].y) / 3)));
}
public static function get triHeight():int{
return (m_triHeight);
}
public static function get triWidth():int{
return (m_triWidth);
}
}
}//package main
Section 126 (1.44 KiB) ●
//Vect (main.Vect)
package main {
public class Vect {
var x:Number;
var y:Number;
public function Vect(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
}
function copyVect(_arg1:Vect):void{
x = _arg1.x;
y = _arg1.y;
}
function setMembers(_arg1:Number, _arg2:Number):void{
x = _arg1;
y = _arg2;
}
function addVect(_arg1:Vect):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
function subVect(_arg1:Vect):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
function mulScalar(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
function getMulScalar(_arg1:Number):Vect{
return (new Vect((x * _arg1), (y * _arg1)));
}
function magnitude():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
function magnitude2():Number{
return (((x * x) + (y * y)));
}
function vectorProjectionOnto(_arg1:Vect):Vect{
var _local2:Vect = _arg1.getUnitVect();
_local2.mulScalar(scalarProjectionOnto(_arg1));
return (_local2);
}
function getUnitVect():Vect{
var _local1:Number = magnitude();
var _local2:Vect = new Vect(x, y);
if (_local1){
_local2.x = (_local2.x / _local1);
_local2.y = (_local2.y / _local1);
};
return (_local2);
}
function scalarProjectionOnto(_arg1:Vect):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) / _arg1.magnitude()));
}
function getDirection():Number{
return (((Math.atan2(y, x) / Math.PI) * 180));
}
}
}//package main
Section 127 (135 B)
//Win1Sound (main.Win1Sound)
package main {
import flash.media.*;
public dynamic class Win1Sound extends Sound {
}
}//package main