Section 1
//boom_2_27 (birds_town_0_fla.boom_2_27)
package birds_town_0_fla {
import flash.display.*;
public dynamic class boom_2_27 extends MovieClip {
public function boom_2_27(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package birds_town_0_fla
Section 2
//cifra_124 (birds_town_0_fla.cifra_124)
package birds_town_0_fla {
import flash.display.*;
public dynamic class cifra_124 extends MovieClip {
public function cifra_124(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame9(){
stop();
}
function frame10(){
stop();
}
function frame11(){
stop();
}
}
}//package birds_town_0_fla
Section 3
//cifra_130 (birds_town_0_fla.cifra_130)
package birds_town_0_fla {
import flash.display.*;
public dynamic class cifra_130 extends MovieClip {
public function cifra_130(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame3(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame9(){
stop();
}
function frame10(){
stop();
}
function frame11(){
stop();
}
}
}//package birds_town_0_fla
Section 4
//lov_2_25 (birds_town_0_fla.lov_2_25)
package birds_town_0_fla {
import flash.display.*;
public dynamic class lov_2_25 extends MovieClip {
public function lov_2_25(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package birds_town_0_fla
Section 5
//pt_tut_mc_11 (birds_town_0_fla.pt_tut_mc_11)
package birds_town_0_fla {
import flash.display.*;
public dynamic class pt_tut_mc_11 extends MovieClip {
public function pt_tut_mc_11(){
addFrameScript(16, frame17);
}
function frame17(){
gotoAndPlay(10);
}
}
}//package birds_town_0_fla
Section 6
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.5.0.12683";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 7
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 8
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 9
//Bird_in_ROW (Bird_in_ROW)
package {
import flash.media.*;
public dynamic class Bird_in_ROW extends Sound {
}
}//package
Section 10
//Bird_Photo (Bird_Photo)
package {
import flash.media.*;
public dynamic class Bird_Photo extends Sound {
}
}//package
Section 11
//Birds_CHANGE (Birds_CHANGE)
package {
import flash.media.*;
public dynamic class Birds_CHANGE extends Sound {
}
}//package
Section 12
//Birds_Connect (Birds_Connect)
package {
import flash.media.*;
public dynamic class Birds_Connect extends Sound {
}
}//package
Section 13
//Birds_Revers_walk (Birds_Revers_walk)
package {
import flash.media.*;
public dynamic class Birds_Revers_walk extends Sound {
}
}//package
Section 14
//Birds_WALK (Birds_WALK)
package {
import flash.media.*;
public dynamic class Birds_WALK extends Sound {
}
}//package
Section 15
//Birds_WALK_in_cage (Birds_WALK_in_cage)
package {
import flash.media.*;
public dynamic class Birds_WALK_in_cage extends Sound {
}
}//package
Section 16
//BirdsTown (BirdsTown)
package {
import flash.events.*;
import flash.display.*;
public class BirdsTown extends Sprite {
private var game:V_GameApp;
public function BirdsTown(){
super();
game = new V_GameApp();
addChild(game);
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onAdded(evt:Event):void{
stage.scaleMode = StageScaleMode.EXACT_FIT;
}
private function drawTriangle():void{
this.graphics.lineStyle(2, 0xFFFFFF);
this.graphics.beginFill(0xFFFFFF, 1);
this.graphics.moveTo(-25, 0);
this.graphics.lineTo(25, 0);
this.graphics.lineTo(0, -540);
this.graphics.lineTo(-25, 0);
this.graphics.endFill();
}
}
}//package
Section 17
//Bonus_Almaz_Appears (Bonus_Almaz_Appears)
package {
import flash.media.*;
public dynamic class Bonus_Almaz_Appears extends Sound {
}
}//package
Section 18
//Bonus_BOMB (Bonus_BOMB)
package {
import flash.media.*;
public dynamic class Bonus_BOMB extends Sound {
}
}//package
Section 19
//BONUS_pause (BONUS_pause)
package {
import flash.media.*;
public dynamic class BONUS_pause extends Sound {
}
}//package
Section 20
//Bonus_pricel (Bonus_pricel)
package {
import flash.media.*;
public dynamic class Bonus_pricel extends Sound {
}
}//package
Section 21
//BONUS_revers (BONUS_revers)
package {
import flash.media.*;
public dynamic class BONUS_revers extends Sound {
}
}//package
Section 22
//BUM01 (BUM01)
package {
import flash.media.*;
public dynamic class BUM01 extends Sound {
}
}//package
Section 23
//BUM02 (BUM02)
package {
import flash.media.*;
public dynamic class BUM02 extends Sound {
}
}//package
Section 24
//BUM03 (BUM03)
package {
import flash.media.*;
public dynamic class BUM03 extends Sound {
}
}//package
Section 25
//coin (coin)
package {
import flash.media.*;
public dynamic class coin extends Sound {
}
}//package
Section 26
//Combo01 (Combo01)
package {
import flash.media.*;
public dynamic class Combo01 extends Sound {
}
}//package
Section 27
//Combo02 (Combo02)
package {
import flash.media.*;
public dynamic class Combo02 extends Sound {
}
}//package
Section 28
//Combo03 (Combo03)
package {
import flash.media.*;
public dynamic class Combo03 extends Sound {
}
}//package
Section 29
//Egg_destroy (Egg_destroy)
package {
import flash.media.*;
public dynamic class Egg_destroy extends Sound {
}
}//package
Section 30
//Egg_destroy_coins (Egg_destroy_coins)
package {
import flash.media.*;
public dynamic class Egg_destroy_coins extends Sound {
}
}//package
Section 31
//Gameplay (Gameplay)
package {
import flash.media.*;
public dynamic class Gameplay extends Sound {
}
}//package
Section 32
//Launch (Launch)
package {
import flash.media.*;
public dynamic class Launch extends Sound {
}
}//package
Section 33
//Level_LOSE (Level_LOSE)
package {
import flash.media.*;
public dynamic class Level_LOSE extends Sound {
}
}//package
Section 34
//Level_WIN (Level_WIN)
package {
import flash.media.*;
public dynamic class Level_WIN extends Sound {
}
}//package
Section 35
//Match (Match)
package {
import flash.media.*;
public dynamic class Match extends Sound {
}
}//package
Section 36
//mouse_click (mouse_click)
package {
import flash.media.*;
public dynamic class mouse_click extends Sound {
}
}//package
Section 37
//mouse_over (mouse_over)
package {
import flash.media.*;
public dynamic class mouse_over extends Sound {
}
}//package
Section 38
//Particles (Particles)
package {
import flash.media.*;
public dynamic class Particles extends Sound {
}
}//package
Section 39
//Photo (Photo)
package {
import flash.media.*;
public dynamic class Photo extends Sound {
}
}//package
Section 40
//Progress_Bar (Progress_Bar)
package {
import flash.media.*;
public dynamic class Progress_Bar extends Sound {
}
}//package
Section 41
//TILE10 (TILE10)
package {
import flash.display.*;
public dynamic class TILE10 extends BitmapData {
public function TILE10(_arg1:int=0x0400, _arg2:int=0x0400){
super(_arg1, _arg2);
}
}
}//package
Section 42
//TILE11 (TILE11)
package {
import flash.display.*;
public dynamic class TILE11 extends BitmapData {
public function TILE11(_arg1:int=0x0400, _arg2:int=0x0400){
super(_arg1, _arg2);
}
}
}//package
Section 43
//TILE12 (TILE12)
package {
import flash.display.*;
public dynamic class TILE12 extends BitmapData {
public function TILE12(_arg1:int=0x0400, _arg2:int=0x0400){
super(_arg1, _arg2);
}
}
}//package
Section 44
//TILE13 (TILE13)
package {
import flash.display.*;
public dynamic class TILE13 extends BitmapData {
public function TILE13(_arg1:int=0x0400, _arg2:int=0x0400){
super(_arg1, _arg2);
}
}
}//package
Section 45
//TILE14 (TILE14)
package {
import flash.display.*;
public dynamic class TILE14 extends BitmapData {
public function TILE14(_arg1:int=800, _arg2:int=600){
super(_arg1, _arg2);
}
}
}//package
Section 46
//TILE20 (TILE20)
package {
import flash.display.*;
public dynamic class TILE20 extends BitmapData {
public function TILE20(_arg1:int=800, _arg2:int=600){
super(_arg1, _arg2);
}
}
}//package
Section 47
//TILE21 (TILE21)
package {
import flash.display.*;
public dynamic class TILE21 extends BitmapData {
public function TILE21(_arg1:int=800, _arg2:int=600){
super(_arg1, _arg2);
}
}
}//package
Section 48
//TILE23 (TILE23)
package {
import flash.display.*;
public dynamic class TILE23 extends BitmapData {
public function TILE23(_arg1:int=0x0400, _arg2:int=0x0400){
super(_arg1, _arg2);
}
}
}//package
Section 49
//V_Anim (V_Anim)
package {
public class V_Anim {
public var lFrame:int;
public var num:int;
public var fFrame:int;
public var loops:int;
public function V_Anim(f:int, l:int, _num:int, loop:int){
super();
fFrame = f;
lFrame = l;
loops = loop;
num = _num;
}
public function Clone():V_Anim{
var anim:V_Anim = new V_Anim(fFrame, lFrame, num, loops);
return (anim);
}
}
}//package
Section 50
//V_Area (V_Area)
package {
import flash.display.*;
public dynamic class V_Area extends MovieClip {
public var b1:MovieClip;
public var b2:MovieClip;
}
}//package
Section 51
//V_Bird (V_Bird)
package {
import flash.display.*;
public class V_Bird extends Sprite {
public var calc_x:Number;
public var calc_y:Number;
private var anim:V_Anim;
public var dx:int;
public var dy:int;
private var mc:MovieClip;
public var inserted:Boolean;
private var sleep_egg:Number;
private var bonus:V_BirdBonus;
public var num_spline:int;
public var Pos:Number;// = 0
private var num_anim:int;// = -1
private var bonus_id:int;// = -1
private var egge_id:int;// = -1
public var vx:Number;// = 0
public var vy:Number;// = 0
private var sc:Number;// = 1
public var moveFlag:Boolean;
public var time_bonus_flash:Number;
public var calc_scale:Number;
private var currFrame:int;
private var myId:int;// = 0
private var d:int;// = 1
public var status:int;
private static var curr_diam:uint = 1;
public function V_Bird(){
super();
}
public function applyMoney():void{
myId = 79;
setBonus(-1);
if (mc){
mc.parent.removeChild(mc);
};
V_Factory.releaseConcreteBird(mc);
mc = V_Factory.createConcreteBird(16);
mc.rotation = (Math.random() * Math.PI);
addChild(mc);
mc.scaleX = (mc.scaleY = 0.5);
mc.gotoAndStop(0);
setAnimation(46, 1, 1);
currFrame = V_Utility.Random_Int(anim.fFrame, anim.lFrame);
}
public function getNumAnim():int{
return (num_anim);
}
public function applyDiamond():void{
myId = 75;
setBonus(-1);
if (mc){
mc.parent.removeChild(mc);
};
V_Factory.releaseConcreteBird(mc);
mc = V_Factory.createConcreteBird((10 + curr_diam));
curr_diam = (curr_diam + 1);
if (curr_diam > 5){
curr_diam = 1;
};
addChild(mc);
mc.gotoAndStop(0);
setAnimation(29, 1, 1);
}
public function getId():int{
return (((egge_id)==-1) ? myId : egge_id);
}
public function CompleteAnimation():Boolean{
return ((anim.loops <= 0));
}
public function playAnimation():void{
currFrame = (currFrame + 1);
if (currFrame > anim.lFrame){
anim.loops = (anim.loops - 1);
currFrame = anim.fFrame;
};
if (mc){
mc.gotoAndStop(currFrame);
};
}
public function setAnimation(num:int, loop:int, dir:int):void{
num_anim = num;
anim = V_Utility.getAnim(num).Clone();
anim.loops = loop;
if (mc){
mc.gotoAndStop(anim.fFrame);
};
currFrame = anim.fFrame;
}
public function update(dt:Number):void{
if (((bonus) && (bonus.parent))){
bonus.update(dt);
};
if (sleep_egg > 0){
sleep_egg = (sleep_egg - dt);
if ((((sleep_egg <= 0)) && ((((egge_id == V_Utility.EGGE_BIRD_DIAMONDS_ID)) || ((egge_id == V_Utility.EGGE_BIRD_MONEY_ID)))))){
applyEggeObject(0);
scaleX = 1;
} else {
if ((((sleep_egg <= 4)) && ((((egge_id == V_Utility.EGGE_BIRD_DIAMONDS_ID)) || ((egge_id == V_Utility.EGGE_BIRD_MONEY_ID)))))){
sc = (sc + (d * dt));
if (sc > 1.15){
sc = 1.15;
d = -1;
} else {
if (sc < 0.85){
sc = 0.85;
d = 1;
};
};
scaleX = sc;
};
};
};
}
public function refresh():void{
setBonus(-1);
}
public function isBonusSowing():Boolean{
return (false);
}
public function getBonus():int{
return ((((bonus) && (bonus.parent))) ? bonus_id : -1);
}
public function getCurrentFrame():int{
return ((((!(anim)) || (!((anim.num == 25))))) ? currFrame : 65);
}
public function setBonus(bonusid:int):void{
bonus_id = bonusid;
if (bonusid < 0){
if (((bonus) && (bonus.parent))){
bonus.parent.removeChild(bonus);
};
return;
};
var bId:int = (getId() - 1);
bonusid = (bonusid + 1);
if (!bonus){
bonus = new V_BirdBonus();
};
bonus.gotoAndStop(((bId * 6) + bonusid));
bonus.x = 8;
bonus.y = 8;
addChild(bonus);
bonus.apply();
}
public function applyEggeObject(num:int):void{
if (((mc) && (mc.parent))){
mc.parent.removeChild(mc);
};
V_Factory.releaseConcreteBird(mc);
setBonus(-1);
switch (num){
case 0:
egge_id = V_Utility.EGGE_BIRD_ID;
break;
case 1:
egge_id = V_Utility.EGGE_BIRD_CEP_ID;
break;
case 2:
egge_id = V_Utility.EGGE_BIRD_MONEY_ID;
V_SoundLib.playSound(7);
sleep_egg = 25;
break;
case 3:
egge_id = V_Utility.EGGE_BIRD_DIAMONDS_ID;
V_SoundLib.playSound(7);
sleep_egg = 25;
break;
};
mc = V_Factory.createConcreteBird((20 + num));
if (mc){
addChild(mc);
mc.gotoAndStop(0);
};
}
public function Update(num:int):void{
if (num <= 0){
num = 1;
};
if (((mc) && (mc.parent))){
mc.parent.removeChild(mc);
};
V_Factory.releaseConcreteBird(mc);
setBonus(-1);
mc = null;
myId = num;
bonus_id = -1;
sleep_egg = 0;
egge_id = -1;
mc = V_Factory.createConcreteBird(num);
if (mc){
addChild(mc);
mc.gotoAndStop(0);
};
}
public function checkBonus(dt:Number):void{
}
public function destroyEggeObject():void{
egge_id = -1;
if (mc){
mc.parent.removeChild(mc);
};
V_SoundLib.playSound(19);
}
}
}//package
class V_BirdBonus extends V_BonusRes {
private var sleep:Number;// = 0
private var dir:int;// = 1
private function V_BirdBonus(){
super();
gotoAndStop(1);
}
public function update(dt:Number):void{
sleep = (sleep - dt);
if (sleep < 4){
scaleX = (scaleX + (dir * dt));
if (scaleX > 1.15){
scaleX = 1.15;
dir = -1;
} else {
if (scaleX < 0.85){
scaleX = 0.85;
dir = 1;
};
};
alpha = (sleep / 4);
scaleY = scaleX;
} else {
if (scaleX < 1){
scaleX = (scaleX + dt);
if (scaleX > 1){
scaleX = 1;
};
scaleY = scaleX;
};
};
}
public function apply():void{
sleep = 30;
dir = 1;
scaleX = (scaleY = 0);
this.alpha = 1;
}
}
Section 52
//V_Bird1 (V_Bird1)
package {
import flash.display.*;
public dynamic class V_Bird1 extends MovieClip {
}
}//package
Section 53
//V_Bird2 (V_Bird2)
package {
import flash.display.*;
public dynamic class V_Bird2 extends MovieClip {
}
}//package
Section 54
//V_Bird3 (V_Bird3)
package {
import flash.display.*;
public dynamic class V_Bird3 extends MovieClip {
}
}//package
Section 55
//V_Bird4 (V_Bird4)
package {
import flash.display.*;
public dynamic class V_Bird4 extends MovieClip {
}
}//package
Section 56
//V_Bird5 (V_Bird5)
package {
import flash.display.*;
public dynamic class V_Bird5 extends MovieClip {
}
}//package
Section 57
//V_Bird6 (V_Bird6)
package {
import flash.display.*;
public dynamic class V_Bird6 extends MovieClip {
}
}//package
Section 58
//V_Bird7 (V_Bird7)
package {
import flash.display.*;
public dynamic class V_Bird7 extends MovieClip {
}
}//package
Section 59
//V_Bird8 (V_Bird8)
package {
import flash.display.*;
public dynamic class V_Bird8 extends MovieClip {
}
}//package
Section 60
//V_BirdCoins (V_BirdCoins)
package {
import flash.display.*;
public dynamic class V_BirdCoins extends MovieClip {
public function V_BirdCoins(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("walk_ani");
}
}
}//package
Section 61
//V_BirdDiamonds (V_BirdDiamonds)
package {
import flash.display.*;
public dynamic class V_BirdDiamonds extends MovieClip {
public function V_BirdDiamonds(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("walk_ani");
}
}
}//package
Section 62
//V_BirdEgge (V_BirdEgge)
package {
import flash.display.*;
public dynamic class V_BirdEgge extends MovieClip {
public function V_BirdEgge(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("walk_ani");
}
}
}//package
Section 63
//V_BirdEggLock (V_BirdEggLock)
package {
import flash.display.*;
public dynamic class V_BirdEggLock extends MovieClip {
public function V_BirdEggLock(){
addFrameScript(12, frame13);
}
function frame13(){
gotoAndPlay("walk_ani");
}
}
}//package
Section 64
//V_BirdItem (V_BirdItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class V_BirdItem extends MovieClip {
public var bird_mc:MovieClip;
public var points_txt:TextField;
}
}//package
Section 65
//V_BirdWithBabl (V_BirdWithBabl)
package {
import flash.display.*;
public dynamic class V_BirdWithBabl extends MovieClip {
public var text_babl:MovieClip;
public var bird:MovieClip;
}
}//package
Section 66
//V_Board (V_Board)
package {
import flash.display.*;
public class V_Board extends Sprite {
private var board:Array;
private var w:int;
private var h:int;
public function V_Board(cw:int, ch:int){
var i:int;
var j:int;
super();
if (!board){
w = cw;
h = ch;
board = new Array();
i = 0;
while (i < w) {
board[i] = new Array();
j = 0;
while (j < h) {
board[i][j] = 0;
j++;
};
i++;
};
};
}
public function getItem(numx:int, numy:int):int{
if (numx >= w){
numx = (w - 1);
};
if (numx < 0){
numx = 0;
};
if (numy >= h){
numy = (h - 1);
};
if (numy < 0){
numy = 0;
};
return (board[numx][numy]);
}
public function setItem(numx:int, numy:int, value:int):void{
board[numx][numy] = value;
}
public function clearBoard():void{
var i:int;
var j:int;
if (board){
i = 0;
while (i < w) {
j = 0;
while (j < h) {
board[i][j] = 0;
j++;
};
i++;
};
};
}
public function checkNodeY(posx:int, posy:int):int{
if (posx < 0){
posx = 0;
};
if (posx >= w){
posx = (w - 1);
};
if (posy < 0){
posy = 0;
};
if (posy >= h){
posy = (h - 1);
};
var res = -1;
var i:int = (h - 1);
while (i >= posy) {
if (board[posx][i] == 2){
res = i;
break;
};
i--;
};
return (res);
}
}
}//package
Section 67
//V_BonusRes (V_BonusRes)
package {
import flash.display.*;
public dynamic class V_BonusRes extends MovieClip {
}
}//package
Section 68
//V_Boom (V_Boom)
package {
import flash.display.*;
public dynamic class V_Boom extends MovieClip {
public function V_Boom(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package
Section 69
//V_BoomParticle (V_BoomParticle)
package {
public class V_BoomParticle extends V_Boom {
public function V_BoomParticle(){
super();
}
public function update(dt:Number):void{
if ((((currentFrame == totalFrames)) && (this.parent))){
this.parent.removeChild(this);
};
}
}
}//package
Section 70
//V_CatchGems (V_CatchGems)
package {
import flash.display.*;
public dynamic class V_CatchGems extends MovieClip {
public function V_CatchGems(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package
Section 71
//V_CatchParticle (V_CatchParticle)
package {
public class V_CatchParticle extends V_CatchGems {
public function V_CatchParticle(){
super();
}
public function update(dt:Number):void{
if ((((currentFrame == totalFrames)) && (this.parent))){
this.parent.removeChild(this);
};
}
}
}//package
Section 72
//V_CatManager (V_CatManager)
package {
public class V_CatManager extends V_CatRes {
private var show:Number;// = 30
private var anim:V_Anim;
private var sleep_smile_2:Number;
private var sleep_anim:Number;// = 0
private var sleep_smile:Number;
private var show_flag:Boolean;// = false
private var flag_smile:Boolean;
private var status:int;// = 0
private var currFrame:uint;// = 0
public function V_CatManager(){
anim = new V_Anim(0, 0, 0, 0);
super();
gotoAndStop(1);
scaleX = -0.5;
scaleY = 0.5;
x = 200;
y = -10;
}
private function setAnimation(num:int):void{
anim.num = num;
switch (num){
case 0:
anim.fFrame = 1;
anim.lFrame = 1;
anim.loops = V_Utility.Random_Int(35, 60);
break;
case 1:
anim.fFrame = 1;
anim.lFrame = 5;
anim.loops = V_Utility.Random_Int(7, 10);
break;
case 2:
anim.fFrame = 6;
anim.lFrame = 6;
anim.loops = V_Utility.Random_Int(7, 10);
break;
case 3:
anim.fFrame = 7;
anim.lFrame = 7;
anim.loops = V_Utility.Random_Int(7, 10);
break;
case 4:
anim.fFrame = 8;
anim.lFrame = 8;
anim.loops = V_Utility.Random_Int(7, 10);
break;
case 5:
anim.fFrame = 9;
anim.lFrame = 9;
anim.loops = V_Utility.Random_Int(7, 10);
break;
case 6:
anim.fFrame = 10;
anim.lFrame = 10;
anim.loops = V_Utility.Random_Int(35, 60);
break;
case 7:
anim.fFrame = 11;
anim.lFrame = 14;
anim.loops = 1;
break;
};
currFrame = anim.fFrame;
gotoAndStop(currFrame);
}
private function update1(dt:Number):void{
show = (show - dt);
y = -10;
if (show <= 0){
show_flag = !(show_flag);
show = (show_flag) ? 5 : 30;
x = (show_flag) ? 230 : 200;
};
}
private function update2(dt:Number):void{
if (!show_flag){
show_flag = true;
x = 230;
};
sleep_smile = (sleep_smile - dt);
if (sleep_smile <= 0){
flag_smile = !(flag_smile);
sleep_smile = (flag_smile) ? 3 : 5;
};
if (flag_smile){
sleep_smile_2 = (sleep_smile_2 - dt);
if (sleep_smile_2 <= 0){
sleep_smile_2 = 0.06;
y = ((y)>=-10) ? -12 : -8;
};
};
}
public function reset():void{
show_flag = true;
flag_smile = false;
sleep_smile = (sleep_smile_2 = 0);
status = 0;
y = -10;
update1(1000000);
setAnimation(0);
}
public function update(dt:Number):void{
switch (status){
case 0:
update1(dt);
break;
default:
update2(dt);
break;
};
playAnimation(dt);
}
private function playAnimation(dt:Number):void{
sleep_anim = (sleep_anim - dt);
if (sleep_anim <= 0){
sleep_anim = 0.04;
currFrame = (currFrame + 1);
if (currFrame > anim.lFrame){
anim.loops = (anim.loops - 1);
currFrame = anim.fFrame;
};
if (anim.loops <= 0){
switch (status){
case 0:
if (anim.num == 0){
setAnimation(V_Utility.Random_Int(1, 5));
} else {
setAnimation(0);
};
break;
case 1:
if (anim.num == 6){
setAnimation(7);
} else {
setAnimation(6);
};
break;
};
};
gotoAndStop(currFrame);
};
}
public function setStatus(st:uint):void{
status = st;
}
}
}//package
Section 73
//V_CatRes (V_CatRes)
package {
import flash.display.*;
public dynamic class V_CatRes extends MovieClip {
public function V_CatRes(){
addFrameScript(0, frame1, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame8(){
stop();
}
function frame9(){
stop();
}
function frame10(){
stop();
}
}
}//package
Section 74
//V_CifraText (V_CifraText)
package {
import flash.display.*;
public dynamic class V_CifraText extends MovieClip {
public var b1:MovieClip;
public var b2:MovieClip;
public var b3:MovieClip;
}
}//package
Section 75
//V_Coin (V_Coin)
package {
import flash.display.*;
public dynamic class V_Coin extends MovieClip {
}
}//package
Section 76
//V_ComboText (V_ComboText)
package {
import flash.display.*;
public dynamic class V_ComboText extends MovieClip {
public var b1:MovieClip;
}
}//package
Section 77
//V_Config (V_Config)
package {
import flash.events.*;
import flash.net.*;
public class V_Config {
private var loader:URLLoader;
private var url:String;// = "config.xml"
public function V_Config(){
super();
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, function (evt:IOErrorEvent):void{
});
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (evt:SecurityErrorEvent):void{
});
loader.load(new URLRequest(url));
}
private function onComplete(evt:Event):void{
var xml:XML = new XML(evt.target.data);
if (xml.game_page){
V_DownLoadManager.url = xml.game_page.@url;
};
}
}
}//package
Section 78
//V_DescriptionTutorial (V_DescriptionTutorial)
package {
import flash.display.*;
public class V_DescriptionTutorial extends Sprite {
public var shadow:V_Tutorial;
private var flag:Boolean;
private var status:int;
private var bird_babl:V_BirdWithBabl;
public function V_DescriptionTutorial(){
shadow = new V_Tutorial();
super();
addChild(shadow);
bird_babl = new V_BirdWithBabl();
addChild(bird_babl);
}
public function hide():void{
flag = false;
}
private function drawBirdBabl(dt:Number):void{
switch (status){
case 1:
if (flag){
if (bird_babl.x < 170){
bird_babl.x = (bird_babl.x + (dt * 700));
if (bird_babl.x > 170){
bird_babl.x = 170.5;
bird_babl.bird.gotoAndPlay(10);
};
} else {
bird_babl.text_babl.visible = true;
};
} else {
bird_babl.bird.gotoAndStop(1);
bird_babl.x = (bird_babl.x - (dt * 700));
bird_babl.text_babl.visible = false;
};
break;
case 2:
if (flag){
if (bird_babl.x > 600){
bird_babl.x = (bird_babl.x - (dt * 700));
if (bird_babl.x < 600){
bird_babl.x = 599;
bird_babl.bird.gotoAndPlay(10);
};
} else {
bird_babl.text_babl.visible = true;
};
} else {
bird_babl.bird.gotoAndStop(1);
bird_babl.x = (bird_babl.x + (dt * 700));
bird_babl.text_babl.visible = false;
};
break;
};
}
public function update(dt:Number):void{
if (flag){
if (shadow.alpha < 1){
shadow.alpha = (shadow.alpha + (dt * 2));
checkSide();
} else {
drawBirdBabl(dt);
};
} else {
drawBirdBabl(dt);
if (shadow.alpha > 0){
shadow.alpha = (shadow.alpha - (dt * 2));
checkSide();
} else {
reset();
};
};
}
public function reset():void{
shadow.alpha = 0;
flag = false;
if (this.parent){
this.parent.removeChild(this);
};
}
public function setDescription(num:int):void{
bird_babl.text_babl.text_mc.gotoAndStop(num);
}
public function show(num:int):void{
num = (num + 1);
shadow.alpha = 0;
flag = true;
bird_babl.text_babl.text_mc.gotoAndStop(num);
bird_babl.text_babl.visible = false;
bird_babl.visible = false;
}
private function checkSide():void{
bird_babl.visible = true;
if (shadow.x > 400){
bird_babl.x = -200;
bird_babl.scaleX = -1;
status = 1;
bird_babl.text_babl.text_mc.scaleX = -1;
} else {
bird_babl.x = 850;
bird_babl.scaleX = 1;
bird_babl.text_babl.text_mc.scaleX = 1;
status = 2;
};
bird_babl.y = 460;
bird_babl.bird.gotoAndStop(1);
}
}
}//package
Section 79
//V_Diam1 (V_Diam1)
package {
import flash.display.*;
public dynamic class V_Diam1 extends MovieClip {
}
}//package
Section 80
//V_Diam2 (V_Diam2)
package {
import flash.display.*;
public dynamic class V_Diam2 extends MovieClip {
}
}//package
Section 81
//V_Diam3 (V_Diam3)
package {
import flash.display.*;
public dynamic class V_Diam3 extends MovieClip {
}
}//package
Section 82
//V_Diam4 (V_Diam4)
package {
import flash.display.*;
public dynamic class V_Diam4 extends MovieClip {
}
}//package
Section 83
//V_Diam5 (V_Diam5)
package {
import flash.display.*;
public dynamic class V_Diam5 extends MovieClip {
}
}//package
Section 84
//V_DownLoadManager (V_DownLoadManager)
package {
import flash.net.*;
public class V_DownLoadManager {
public static var url:String = "";
public function V_DownLoadManager(){
super();
}
public static function download():void{
if (url.length > 0){
navigateToURL(new URLRequest(url), "_blank");
};
}
}
}//package
Section 85
//V_End2Wnd (V_End2Wnd)
package {
import flash.display.*;
public dynamic class V_End2Wnd extends MovieClip {
public function V_End2Wnd(){
addFrameScript(150, frame151);
}
function frame151(){
stop();
}
}
}//package
Section 86
//V_EventMatch3 (V_EventMatch3)
package {
import flash.events.*;
public class V_EventMatch3 extends Event {
public var count_birds:int;
public var type_bird:int;
public var combo:int;
public var time_value:Number;
public function V_EventMatch3(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
public function _trace():void{
trace(time_value, count_birds, combo, type_bird);
}
}
}//package
Section 87
//V_Factory (V_Factory)
package {
import flash.display.*;
public class V_Factory {
private static var concreteFactory:V_ConcreteBirdFactory;
private static var birdFactory:V_BirdFactory;
private static var comboFactory:V_ComboFactory;
private static var textFactory:V_TextFactory;
public function V_Factory(){
super();
}
public static function releaseBird(ref:V_Bird):void{
birdFactory.releaseBird(ref);
}
public static function createConcreteBird(type:int):MovieClip{
return (concreteFactory.createTypeBird(type));
}
public static function releaseCombo(ref:V_TextCombo):void{
comboFactory.releaseCombo(ref);
}
public static function createPointsText():V_PointsText{
return (textFactory.createText());
}
public static function initialize():void{
birdFactory = new V_BirdFactory();
concreteFactory = new V_ConcreteBirdFactory();
textFactory = new V_TextFactory();
comboFactory = new V_ComboFactory();
}
public static function createCombo():V_TextCombo{
return (comboFactory.createCombo());
}
public static function releaseConcreteBird(ref:MovieClip):void{
concreteFactory.releaseTypeBird(ref);
}
public static function createBird():V_Bird{
return (birdFactory.createBird());
}
public static function releasePointsText(ref:V_PointsText):void{
textFactory.releaseText(ref);
}
}
}//package
import flash.display.*;
class V_ComboFactory {
private var hash:Array;
private function V_ComboFactory(){
hash = new Array();
super();
}
public function createCombo():V_TextCombo{
var c:V_TextCombo;
if (hash.length){
c = (hash.shift() as V_TextCombo);
} else {
c = new V_TextCombo();
};
return (c);
}
public function releaseCombo(ref:V_TextCombo):void{
if (ref){
hash.push(ref);
};
}
}
class V_BirdFactory {
private var hash:Array;
private function V_BirdFactory(){
super();
hash = new Array();
}
public function releaseBird(ref:V_Bird):void{
if (ref){
hash.push(ref);
};
}
public function createBird():V_Bird{
var b:V_Bird;
if (hash.length){
b = (hash.shift() as V_Bird);
} else {
b = new V_Bird();
};
b.visible = true;
return (b);
}
}
class V_TextFactory {
private var hash:Array;
private function V_TextFactory(){
hash = new Array();
super();
}
public function createText():V_PointsText{
var c:V_PointsText;
if (hash.length){
c = (hash.shift() as V_PointsText);
} else {
c = new V_PointsText();
};
return (c);
}
public function releaseText(ref:V_PointsText):void{
if (ref){
hash.push(ref);
};
}
}
class V_ConcreteBirdFactory {
private var hash:Array;
private function V_ConcreteBirdFactory(){
hash = new Array();
super();
}
public function releaseTypeBird(ref:MovieClip):void{
if (!ref){
return;
};
var type:int = int(ref.name);
hash[type].push(ref);
}
public function createTypeBird(type:int):MovieClip{
var mc:MovieClip;
if (!hash[type]){
hash[type] = new Array();
};
if (hash[type].length){
return ((hash[type].shift() as MovieClip));
};
switch (type){
case 1:
mc = new V_Bird1();
break;
case 2:
mc = new V_Bird2();
break;
case 3:
mc = new V_Bird3();
break;
case 4:
mc = new V_Bird4();
break;
case 5:
mc = new V_Bird5();
break;
case 6:
mc = new V_Bird6();
break;
case 7:
mc = new V_Bird7();
break;
case 8:
mc = new V_Bird8();
break;
case 11:
mc = new V_Diam1();
break;
case 12:
mc = new V_Diam2();
break;
case 13:
mc = new V_Diam3();
break;
case 14:
mc = new V_Diam4();
break;
case 15:
mc = new V_Diam5();
break;
case 16:
mc = new V_Coin();
break;
case 20:
mc = new V_BirdEgge();
break;
case 21:
mc = new V_BirdEggLock();
break;
case 22:
mc = new V_BirdCoins();
break;
case 23:
mc = new V_BirdDiamonds();
break;
};
mc.name = type.toString();
return (mc);
}
}
Section 88
//V_FinishWnd (V_FinishWnd)
package {
import flash.events.*;
public class V_FinishWnd extends V_End2Wnd implements V_IWindow {
private var sleep:Number;// = 0
public function V_FinishWnd(){
super();
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
gotoAndStop(1);
x = 400;
y = 300;
this.scaleX = (this.scaleY = (800 / 640));
}
public function update(dt:Number):void{
sleep = (sleep - dt);
if (sleep > 0){
return;
};
sleep = 0.033;
if (currentFrame != totalFrames){
this.nextFrame();
};
}
public function hide():void{
}
public function show():void{
V_SoundLib.playMusic(0);
gotoAndStop(1);
}
private function onMouse(evt:MouseEvent):void{
V_DownLoadManager.download();
}
}
}//package
Section 89
//V_Fotka (V_Fotka)
package {
import flash.display.*;
public dynamic class V_Fotka extends MovieClip {
public var text_mc:MovieClip;
}
}//package
Section 90
//V_Foto (V_Foto)
package {
import flash.display.*;
import flash.geom.*;
public class V_Foto extends Sprite {
private var bird:V_Bird;
private var acc:Number;// = 0
private var is_event:Boolean;// = false
private var dir:int;// = 1
private var b1:Bitmap;
private var b2:Bitmap;
private var spline:V_Spline;
private var lose:Boolean;// = false
private var b3:Bitmap;
private var fotka:V_Fotka;
private var sleep:Number;// = 0
private var p:V_SplinePoint;
private var bd3:BitmapData;
private var t:Number;// = 0
private var bd1:BitmapData;
private var bd2:BitmapData;
private var cx:Number;// = 0
private var cy:Number;// = 0
private var state:int;// = 0
public function V_Foto(){
p = new V_SplinePoint();
super();
spline = new V_Spline();
var p1:V_SplinePoint = new V_SplinePoint();
var p2:V_SplinePoint = new V_SplinePoint();
var p3:V_SplinePoint = new V_SplinePoint();
var p4:V_SplinePoint = new V_SplinePoint();
p1.x = -100;
p1.y = -100;
p2.x = 198;
p2.y = 67;
p3.x = 1000;
p3.y = -45;
p4.x = -400;
p4.y = 10;
spline.initSpline(p1, p2, p3, p4);
b1 = new Bitmap();
b2 = new Bitmap();
b3 = new Bitmap();
bird = new V_Bird();
addChild(b3);
addChild(b1);
addChild(b2);
addChild(bird);
fotka = new V_Fotka();
addChild(fotka);
fotka.x = -140;
fotka.y = -130;
b3.x = (b1.x = (b2.x = (-240 * 0.5)));
b3.y = (b1.y = (b2.y = (-220 * 0.5)));
bird.x = 0;
bird.y = 0;
bird.scaleX = (bird.scaleY = 1.6);
bd1 = new BitmapData(240, 220, true, 0);
bd2 = new BitmapData(240, 220, true, 0);
bd3 = new BitmapData(240, 220, true, 0);
b1.bitmapData = bd1;
b2.bitmapData = bd2;
b3.bitmapData = bd3;
}
public function getIsEvent():Boolean{
return (is_event);
}
public function show(st:int):void{
crop();
is_event = false;
sleep = 1;
dir = 1;
acc = 0;
t = 0.0015;
state = st;
cx = 0;
cy = 0;
acc = 0;
bird.Update(V_Utility.bird_id);
bird.setAnimation(V_Utility.anim_id, 1, 1);
bird.rotation = V_Utility.rotate;
bird.scaleX = (bird.scaleY = 2.6);
bird.playAnimation();
switch (st){
case 1:
sleep = 0.1;
cy = -50;
break;
case 2:
t = 3;
acc = 0;
this.alpha = 0;
sleep = 10;
break;
};
}
public function reset():void{
is_event = false;
if (this.parent){
this.parent.removeChild(this);
};
}
public function crop():void{
var cx:Number;
var cy:Number;
var crop_s:Number;
var r:Number;
var l:Number;
var t:Number;
var b:Number;
if (!lose){
cx = 0;
cy = 0;
crop_s = 1;
crop_s = 0.5;
r = (V_Utility.x + (240 * crop_s));
l = (V_Utility.x - (240 * crop_s));
t = (V_Utility.y - (220 * crop_s));
b = (V_Utility.y + (220 * crop_s));
if (r > 800){
l = (l - (r - 800));
r = 800;
};
if (l < 0){
r = (r + Math.abs(l));
l = 0;
};
if (b > 600){
t = (t - (b - 600));
b = 600;
};
if (t < 0){
b = (b + Math.abs(t));
t = 0;
};
bd2 = new BitmapData(240, 220, true, 0);
b2.bitmapData = bd2;
bd1.copyPixels(V_Utility.back1, new Rectangle(l, t, (r - l), (b - t)), new Point(0, 0), null, null, false);
bd2.copyPixels(V_Utility.back2, new Rectangle(l, t, (r - l), (b - t)), new Point(0, 0), null, null, true);
bd3.copyPixels(V_Utility.back3, new Rectangle(l, t, (r - l), (b - t)), new Point(0, 0), null, null, true);
};
var id:int = (V_Utility.bird_id - 1);
if (id == 7){
id = 4;
};
var anum:int = (V_Utility.anim_id - 33);
fotka.text_mc.gotoAndStop(((id * 3) + anum));
}
public function calc(dt:Number):void{
var a:Number;
switch (state){
case 0:
if ((((t > 0)) && ((t < 1)))){
acc = (acc + dt);
if (acc > 2){
acc = 2;
};
t = (t + ((dt * dir) * acc));
if (t <= 0){
is_event = true;
};
if (t >= 1){
t = 1;
};
p = spline.getPoint(t);
x = p.x;
y = p.y;
};
if (sleep > 0){
sleep = (sleep - dt);
if (sleep < 0){
hide();
};
};
break;
case 1:
cx = (cx - (dt * 300));
cy = (cy + (dt * acc));
acc = (acc + (1200 * dt));
x = (400 + cx);
y = (150 + cy);
break;
case 2:
if (sleep > 0){
sleep = (sleep - dt);
return;
};
acc = (acc + (dt * 100));
a = this.alpha;
a = (a + (acc * dt));
t = (t - ((acc * dt) * 0.09));
if (a > 1){
a = 1;
};
if (t < 1){
t = 1;
};
this.alpha = a;
this.scaleX = (this.scaleY = t);
x = (400 + cx);
y = (260 + cy);
if ((((t <= 1)) && ((a >= 1)))){
state = 3;
acc = 100;
};
break;
case 3:
cy = (cy - (acc * dt));
acc = (acc - (dt * 330));
if (acc < 1){
is_event = true;
state = 4;
V_SoundLib.playSound(1);
};
y = (260 + cy);
x = (400 + cx);
break;
case 4:
break;
};
}
public function hide():void{
t = 0.9995;
acc = 0;
dir = -1;
is_event = false;
if (this.parent){
this.parent.removeChild(this);
};
}
public function update(dt:Number):void{
if (!this.parent){
return;
};
calc(dt);
}
public function mouseDown():void{
if ((((t >= 1)) && ((sleep > 0.15)))){
sleep = 0.15;
};
}
}
}//package
Section 91
//V_GameApp (V_GameApp)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class V_GameApp extends Sprite {
private var config:V_Config;
private var lTime:Number;
private var gui:V_Gui;
private var logic:V_GameLogic;
public static const V_GAME_EVENT_HIDE_GAME_INTERFACE:String = "V_GAME_EVENT_HIDE_GAME_INTERFACE";
public static const V_GAME_EVENT_COMPLETE:String = "V_GAME_EVENT_COMPLETE";
public static const V_GAME_EVENT_NOCOMPLETE:String = "V_GAME_EVENT_NOCOMPLETE";
public static const V_GAME_EVENT_CHECK_MATCH3:String = "V_GAME_EVENT_CHECK_MATCH3";
public function V_GameApp(){
V_Factory.initialize();
V_SoundLib.init();
config = new V_Config();
super();
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onLoadedLevel(evt:Event):void{
gui.hideAll();
gui.show(V_Gui.INTERFACE_WND);
gui.show(V_Gui.START_GAME_WND);
logic.visible = true;
V_SoundLib.playMusic(0);
}
private function onAdded(evt:Event):void{
V_Utility.addAnim(new V_Anim(1, 1, 0, 1));
V_Utility.addAnim(new V_Anim(3, 13, 1, 1));
V_Utility.addAnim(new V_Anim(1, 1, 2, 1));
V_Utility.addAnim(new V_Anim(14, 33, 3, 1));
V_Utility.addAnim(new V_Anim(34, 35, 4, 1));
V_Utility.addAnim(new V_Anim(35, 44, 5, 1));
V_Utility.addAnim(new V_Anim(46, 49, 6, 1));
V_Utility.addAnim(new V_Anim(50, 50, 7, 1));
V_Utility.addAnim(new V_Anim(51, 51, 8, 1));
V_Utility.addAnim(new V_Anim(51, 51, 9, 1));
V_Utility.addAnim(new V_Anim(56, 59, 10, 1));
V_Utility.addAnim(new V_Anim(1, 1, 11, 1));
V_Utility.addAnim(new V_Anim(60, 67, 12, 1));
V_Utility.addAnim(new V_Anim(1, 1, 13, 1));
V_Utility.addAnim(new V_Anim(1, 14, 14, 1));
V_Utility.addAnim(new V_Anim(14, 14, 15, 1));
V_Utility.addAnim(new V_Anim(65, 66, 16, 1));
V_Utility.addAnim(new V_Anim(1, 7, 17, 1));
V_Utility.addAnim(new V_Anim(52, 52, 18, 10));
V_Utility.addAnim(new V_Anim(53, 53, 19, 10));
V_Utility.addAnim(new V_Anim(54, 54, 20, 10));
V_Utility.addAnim(new V_Anim(55, 55, 21, 10));
V_Utility.addAnim(new V_Anim(1, 49, 22, 100));
V_Utility.addAnim(new V_Anim(1, 25, 23, 1));
V_Utility.addAnim(new V_Anim(1, 13, 24, 1));
V_Utility.addAnim(new V_Anim(68, 68, 25, 1));
V_Utility.addAnim(new V_Anim(1, 1, 26, 1));
V_Utility.addAnim(new V_Anim(3, 13, 27, 1));
V_Utility.addAnim(new V_Anim(14, 30, 28, 1));
V_Utility.addAnim(new V_Anim(1, 16, 29, 1));
V_Utility.addAnim(new V_Anim(1, 16, 30, 1));
V_Utility.addAnim(new V_Anim(1, 16, 31, 1));
V_Utility.addAnim(new V_Anim(1, 16, 32, 1));
V_Utility.addAnim(new V_Anim(1, 16, 33, 1));
V_Utility.addAnim(new V_Anim(69, 69, 34, 7));
V_Utility.addAnim(new V_Anim(70, 70, 35, 7));
V_Utility.addAnim(new V_Anim(71, 71, 36, 7));
V_Utility.addAnim(new V_Anim(1, 1, 37, 1));
V_Utility.addAnim(new V_Anim(3, 13, 38, 1));
V_Utility.addAnim(new V_Anim(14, 30, 39, 1));
V_Utility.addAnim(new V_Anim(1, 1, 40, 1));
V_Utility.addAnim(new V_Anim(3, 13, 41, 1));
V_Utility.addAnim(new V_Anim(14, 30, 42, 1));
V_Utility.addAnim(new V_Anim(1, 1, 43, 1));
V_Utility.addAnim(new V_Anim(3, 13, 44, 1));
V_Utility.addAnim(new V_Anim(14, 30, 45, 1));
V_Utility.addAnim(new V_Anim(1, 15, 46, 1));
logic = new V_GameLogic();
addChild(logic);
logic.visible = false;
logic.addEventListener(V_GameLogic.EVENT_LOADED_LEVEL, onLoadedLevel);
logic.addEventListener(V_GameLogic.EVENT_SHOW_FOTO, onLogicLister);
logic.addEventListener(V_GAME_EVENT_NOCOMPLETE, onLogicLister);
logic.addEventListener(V_GAME_EVENT_CHECK_MATCH3, onMatch3);
logic.addEventListener(V_GAME_EVENT_COMPLETE, onLogicLister);
logic.addEventListener(V_GameApp.V_GAME_EVENT_HIDE_GAME_INTERFACE, onLogicLister);
gui = new V_Gui();
addChild(gui);
gui.show(V_Gui.MENU_WND);
gui.addEventListener(V_MenuWnd.EVENT_START_PLAY_GAME, onGuiListener);
gui.addEventListener(V_IntrefaceWnd.EVENT_PAUSE, onGuiListener);
gui.addEventListener(V_PauseWnd.EVENT_RESTART_LEVEL, onGuiListener);
stage.addEventListener(Event.ENTER_FRAME, onRender);
lTime = getTimer();
V_SoundLib.playMusic(0);
}
private function createLevel(num:uint):void{
logic.visible = false;
V_User.refreshLevelProgress();
if (num > 8){
gui.show(V_Gui.FINISH_WND);
return;
};
V_SoundLib.stopMusic(0);
gui.hideAll();
gui.show(V_Gui.LOADER_WND);
logic.loadFromBytes(V_Levels.getLevel(num));
}
private function onLogicLister(evt:Event):void{
switch (evt.type){
case V_GAME_EVENT_NOCOMPLETE:
logic.visible = false;
gui.hideAll();
gui.show(V_Gui.GAME_OVER_WND);
break;
case V_GAME_EVENT_COMPLETE:
logic.Pause = true;
gui.hideAll();
gui.show(V_Gui.SCORE_WND);
V_User.curr_level = (V_User.curr_level + 1);
break;
case V_GameLogic.EVENT_SHOW_FOTO:
gui.show(V_Gui.FLASH_WND);
break;
case V_GameApp.V_GAME_EVENT_HIDE_GAME_INTERFACE:
gui.hide(V_Gui.INTERFACE_WND);
break;
};
}
private function onMatch3(evt:V_EventMatch3):void{
V_User.birds_level[evt.type_bird] = (V_User.birds_level[evt.type_bird] + evt.count_birds);
if (evt.type_bird < 8){
V_User.combo_level = (V_User.combo_level + ((evt.combo)>1) ? evt.combo : 0);
};
V_User.progress_level = evt.time_value;
if (evt.type_bird < 9){
V_User.points = (V_User.points + ((evt.count_birds * evt.combo) * 10));
} else {
V_User.points = (V_User.points + evt.count_birds);
};
var wnd:V_IntrefaceWnd = (gui.getRfeWindow(V_Gui.INTERFACE_WND) as V_IntrefaceWnd);
wnd.applyProgress();
}
private function onGuiListener(evt:Event):void{
switch (evt.type){
case V_MenuWnd.EVENT_START_PLAY_GAME:
gui.hideAll();
createLevel(V_User.curr_level);
break;
case V_IntrefaceWnd.EVENT_PAUSE:
logic.Pause = !(logic.Pause);
if (logic.Pause){
gui.show(V_Gui.PAUSE_WND);
} else {
gui.hide(V_Gui.PAUSE_WND);
};
break;
case V_PauseWnd.EVENT_RESTART_LEVEL:
gui.hideAll();
createLevel(V_User.curr_level);
break;
};
}
private function onRender(evt:Event):void{
var dt:Number = ((getTimer() - lTime) * 0.001);
if (dt > 0.05){
dt = 0.05;
};
lTime = getTimer();
gui.update(dt);
logic.render(dt);
}
}
}//package
Section 92
//V_GameLogic (V_GameLogic)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.net.*;
public class V_GameLogic extends Sprite {
private const STATUS_STEP_BACK_OBJ:int = 101;
private const STATUS_BACK_MOVE_OBJ:int = 103;
private const STATUS_TORMOZ_OBJ:int = 105;
private const STATUS_WAIT_OBJ:int = 104;
private const STATUS_BONUS_FLASH:int = 108;
private const STATUS_SLOW_SPEED:int = 111;
private const STATUS_START_SPEED:int = 110;
private const STATUS_BONUS_FLASH_COMPLETE:int = 109;
private const STATUS_BONUS_STOP_MOVE:int = 107;
private const STATUS_END_SPEED:int = 112;
private const STATUS_BONUS_BACK_MOVE:int = 106;
private const STATUS_NORMAL_OBJ:int = 0;
private var cam_y:Number;// = 0
private var flag_loose:Boolean;// = false
private var cam_x:Number;// = 0
private var dwnTiles:Bitmap;
private var ps_layer:Sprite;
private var calc_time_diamonds_egg:Number;
private var bonuses_types_rnd:Array;
private var pp1:V_SplinePoint;
private var shot_obj:V_Bird;
private var pp2:V_SplinePoint;
private var max_cepochka_egge_bird_cep:int;
private var calc_time_moneys_egg:Number;
private var pp3:V_SplinePoint;
private var flag_start_zoom:Boolean;
private var speed:Number;// = 0
private var flag_end_game:Boolean;// = false
private var bird_layer:Sprite;
private var pp4:V_SplinePoint;
private var game_path:V_Path;
private var bytes_from_embed:ByteArray;
private var game_board:V_Board;
private var curr_count_checks_birds:int;// = 0
private var p:V_SplinePoint;
private var jitter_pos:Number;// = 1
private var frequency_egge_bird_cep:int;
private var particle:V_StartParticle;
private var jitter_spline:V_Spline;
private var tutorial1:V_Tutorial1;
private var tutorial2:V_Tutorial2;
private var count_diamonds_egg:Number;
private var lastPoint:V_SplinePoint;
private var tutorial3:V_Tutotrial3;
private var tutorial4:V_Tutorial4;
private var count_moneys_egg:Number;
private var count_birds_level:int;// = 0
private var max_cepochka_egge_bird:int;// = 0
private var point2:V_SplinePoint;
private var del_egges_bird:Array;
private var fon:Bitmap;
private var bonuses_types:Array;
private var random_for_catapult:Array;
private var birds_types:Array;
private var last_time_reverse_bonus:Number;// = 0
private var cam_scale:Number;// = 0
private var up_tiles:Sprite;
private var mas_del_objs:Array;
private var sleep_start_time:Number;// = 0
private var isLoadedLevel:Boolean;// = false
private var last_switch:Number;// = 0
private var foto:V_Foto;
private var general_birds_level:int;// = 0
private var bonuses:Array;
private var match3:Array;
private var que_objs:Array;
private var hook:V_Hook;
private var anim_sleep:Number;// = 0.04
private var val1:Number;// = 2
private var description_tutor:V_DescriptionTutorial;
private var mas_objs:Array;
private var val2:Number;// = 0
private var sleep_time:Number;// = 1
private var katapulta:V_Katapulta;
private var lTime:Number;// = 0
private var flag_pause:Boolean;// = false
private var url:ByteArray;
private var egges:Array;
private var frequency_egge_bird:int;// = 0
private var frequency_bonus:int;// = 0
private var point:V_SplinePoint;
private var combo:int;// = 0
private var time_moneys_egge:Number;
private var first_flag:Boolean;// = false
private var random_for_game:Array;
private var down_tiles:Sprite;
private var upTiles:Bitmap;
private var time_diamonds_egge:Number;
private var game_speed:Number;// = 0
private var text_layer:Sprite;
private var p1:V_SplinePoint;
private var p2:V_SplinePoint;
private var cat:V_CatManager;
private var cepochka:int;// = 0
private var bird_top_layer:Sprite;
private var mas_splines:Array;
private var curr_count_birds_level:int;// = 0
private static const MAX_SLEEP_TIME:Number = 20;
public static const EVENT_SHOW_FOTO:String = "EVENT_SHOW_FOTO";
public static const EVENT_LOADED_LEVEL:String = "LOADED_LEVEL";
public function V_GameLogic(){
lastPoint = new V_SplinePoint();
random_for_game = new Array();
p = new V_SplinePoint();
random_for_catapult = new Array();
point = new V_SplinePoint();
point2 = new V_SplinePoint();
match3 = new Array();
bonuses = new Array();
del_egges_bird = new Array();
mas_del_objs = new Array();
egges = new Array();
jitter_spline = new V_Spline();
pp1 = new V_SplinePoint();
pp2 = new V_SplinePoint();
pp3 = new V_SplinePoint();
pp4 = new V_SplinePoint();
bonuses_types_rnd = new Array();
super();
que_objs = new Array();
birds_types = new Array();
mas_splines = new Array();
bonuses_types = new Array();
game_path = new V_Path();
mas_objs = new Array();
fon = new Bitmap();
addChild(fon);
down_tiles = new Sprite();
dwnTiles = new Bitmap();
addChild(dwnTiles);
dwnTiles.smoothing = true;
bird_layer = new Sprite();
addChild(bird_layer);
particle = new V_StartParticle();
hook = new V_Hook();
addChild(hook);
hook.gotoAndStop(1);
cat = new V_CatManager();
hook.addChildAt(cat, 0);
up_tiles = new Sprite();
upTiles = new Bitmap();
addChild(upTiles);
upTiles.smoothing = true;
katapulta = new V_Katapulta();
addChild(katapulta);
bird_top_layer = new Sprite();
addChild(bird_top_layer);
ps_layer = new Sprite();
addChild(ps_layer);
text_layer = new Sprite();
addChild(text_layer);
game_board = new V_Board(80, 60);
foto = new V_Foto();
tutorial1 = new V_Tutorial1();
tutorial1.setRefObjects(mas_objs);
tutorial2 = new V_Tutorial2();
tutorial2.setRefObjects(mas_objs);
tutorial3 = new V_Tutotrial3();
tutorial3.setRefObjects(egges, mas_objs);
tutorial4 = new V_Tutorial4();
description_tutor = new V_DescriptionTutorial();
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
}
private function onMouse(evt:MouseEvent):void{
switch (evt.type){
case MouseEvent.MOUSE_DOWN:
if (!tutorial1.isLearned()){
if (tutorial1.isLockFire()){
return;
};
};
if (!tutorial2.isLearned()){
if (tutorial2.isLockFire()){
return;
};
};
if (!tutorial3.isLearned()){
if (tutorial3.isLockFire()){
return;
};
};
if (tutorial4.isLockFire()){
return;
};
if ((((((((((((shot_obj == null)) && (!(flag_end_game)))) && (!(flag_pause)))) && (isLoadedLevel))) && (!(first_flag)))) && (!(flag_end_game)))){
if (tutorial4.isLearned()){
description_tutor.hide();
};
shot_obj = katapulta.fire();
if (shot_obj != null){
bird_top_layer.addChild(shot_obj);
shot_obj.moveFlag = true;
shot_obj.calc_x = katapulta.x;
shot_obj.calc_y = katapulta.y;
shot_obj.vy = shot_obj.calc_y;
shot_obj.x = shot_obj.calc_x;
shot_obj.y = shot_obj.calc_y;
if (shot_obj.getCurrentFrame() == 65){
setAnumation(shot_obj, 25, 1, 1);
} else {
setAnumation(shot_obj, V_Utility.FLY_FROM_KATAPULTA_ANIM, 1, 1);
};
V_SoundLib.playSound(21);
};
};
break;
case MouseEvent.MOUSE_MOVE:
if (!tutorial1.isLearned()){
if (tutorial1.isLockMoving()){
return;
};
};
if (!tutorial2.isLearned()){
if (tutorial2.isLockMoving()){
return;
};
};
if (!tutorial3.isLearned()){
if (tutorial3.isLockMoving()){
return;
};
};
if (tutorial4.isLockMoving()){
return;
};
if (((((isLoadedLevel) && (!(flag_pause)))) && (!(flag_end_game)))){
katapulta.x = this.mouseX;
};
katapulta.y = 560;
break;
case MouseEvent.MOUSE_WHEEL:
switchBirds();
break;
};
}
private function switchBirds():void{
if (!tutorial1.isLearned()){
return;
};
if (!tutorial2.isLearned()){
if (tutorial2.isLockFire()){
return;
};
};
if (!tutorial3.isLearned()){
if (tutorial3.isLockFire()){
return;
};
};
if (((((((isLoadedLevel) && (!(flag_pause)))) && (!(flag_end_game)))) && (((getTimer() - last_switch) > 500)))){
if (!tutorial4.isLearned()){
tutorial4.learning();
description_tutor.hide();
};
V_SoundLib.playSound(2);
katapulta.switchBird();
last_switch = getTimer();
};
}
private function checkSleepTime(dt:Number):void{
var flag:Boolean;
var dist:Number;
var i:int;
var p_i:int;
var p_j:int;
var sny:Number;
var new_dist:Number;
var dbb:Number;
var ndx:Number;
var ndy:Number;
if (flag_pause){
return;
};
if (((!(shot_obj)) || (V_Utility.isRenderToTargetForCurrGame))){
if (sleep_time > 1){
sleep_time = (sleep_time - (dt * 50));
if (sleep_time <= 1){
sleep_time = 1;
};
};
return;
};
var dx:Number = 1000;
var dy:Number = 1000;
if ((((((count_birds_level <= 0)) && ((que_objs.length <= 0)))) && (!((shot_obj.getCurrentFrame() == 65))))){
flag = false;
dist = 1000;
i = 0;
while (i < mas_objs.length) {
if (sleep_time > 1.2){
mas_objs[i].setBonus(-1);
if (katapulta.isTriple()){
katapulta.setFlagTriple(false);
};
};
if (mas_objs[i].getId() != shot_obj.getId()){
flag = false;
break;
};
if (i > 0){
dbb = V_Utility.distance(mas_objs[i].calc_x, mas_objs[i].calc_y, mas_objs[(i - 1)].calc_x, mas_objs[(i - 1)].calc_y);
if (dbb > (V_Utility.DISTANCE_BETWEEN_BIRD + 5)){
flag = false;
break;
};
};
p_i = (mas_objs[i].calc_x / 20);
p_j = (mas_objs[i].calc_y / 20);
if (game_board.getItem(p_i, p_j) != 0){
} else {
sny = shot_obj.calc_y;
new_dist = (shot_obj.calc_y - mas_objs[i].calc_y);
if ((((shot_obj.vy <= mas_objs[i].calc_y)) && ((shot_obj.calc_y >= mas_objs[i].calc_y)))){
new_dist = 15;
};
if ((((new_dist > 150)) || ((new_dist < 0)))){
} else {
flag = true;
};
};
i++;
};
if (((flag) && ((mas_objs.length >= 2)))){
i = 0;
while (i < mas_objs.length) {
ndx = Math.abs((mas_objs[i].calc_x - shot_obj.calc_x));
new_dist = V_Utility.distance(mas_objs[i].calc_x, mas_objs[i].calc_y, shot_obj.calc_x, shot_obj.calc_y);
if ((((new_dist < dist)) && ((mas_objs[i].calc_y < shot_obj.calc_y)))){
dist = new_dist;
};
if ((((ndx < dx)) && ((mas_objs[i].calc_y < shot_obj.calc_y)))){
dx = ndx;
ndy = Math.abs((mas_objs[i].calc_y - shot_obj.calc_y));
dy = ndy;
};
i++;
};
if ((((((dist >= 0)) && ((dist <= 150)))) && ((dx <= V_Utility.DISTANCE_BETWEEN_BIRD)))){
sleep_time = (sleep_time + (dt * 40));
if (sleep_time > MAX_SLEEP_TIME){
sleep_time = MAX_SLEEP_TIME;
};
if ((((dist <= 160)) && ((sleep_time >= MAX_SLEEP_TIME)))){
if (((!((shot_obj.getNumAnim() == V_Utility.FLY_IN_CROWD_ANIM))) && ((shot_obj.getNumAnim() < 34)))){
setAnumation(shot_obj, V_Utility.FLY_IN_CROWD_ANIM, 1, 1);
};
};
} else {
sleep_time = (sleep_time - (dt * 100));
if (sleep_time <= 1){
sleep_time = 1;
};
};
} else {
sleep_time = (sleep_time - (dt * 100));
if (sleep_time <= 1){
sleep_time = 1;
};
};
};
}
public function checkMatch3(index:int):void{
var bx:Number;
var by:Number;
var type:int;
var bonus_bird:int;
var last_pos:int;
var flag_clear:Boolean;
var i:int;
var dist:Number;
var create_bons:Boolean;
var ref:V_Bird;
var num:int;
var del:V_Bird;
var _event:V_EventMatch3;
var egg_pos:int;
var egg:V_Bird;
var rnd_dir:int;
var rid:int;
var d:Number;
var l_id:int;
var r_id:int;
if ((((index >= 0)) && ((index < mas_objs.length)))){
match3.length = 0;
match3.push(index);
bx = 0;
by = 0;
type = mas_objs[index].getId();
bonus_bird = -1;
last_pos = -1;
flag_clear = true;
bonuses.length = 0;
i = (index + 1);
while (i < mas_objs.length) {
if ((((mas_objs[i].getId() == type)) && (!((mas_objs[i].getNumAnim() == V_Utility.DIGIT_ANIM))))){
dist = distanceBetweenObjs(mas_objs[i], mas_objs[(i - 1)]);
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD + 20)){
match3.push(i);
} else {
break;
};
} else {
break;
};
i++;
};
i = (index - 1);
while (i >= 0) {
if ((((mas_objs[i].getId() == type)) && (!((mas_objs[i].getNumAnim() == V_Utility.DIGIT_ANIM))))){
dist = distanceBetweenObjs(mas_objs[i], mas_objs[(i + 1)]);
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD + 20)){
match3.splice(0, 0, i);
} else {
break;
};
} else {
break;
};
i--;
};
if (match3.length >= 3){
V_SoundLib.playSound(24);
bonuses.length = 0;
create_bons = false;
i = 0;
for (;i < match3.length;i++) {
ref = mas_objs[match3[i]];
if (i == 0){
last_pos = ref.Pos;
};
if ((((((ref.getId() == V_Utility.EGGE_BIRD_ID)) || ((ref.getId() == V_Utility.EGGE_BIRD_DIAMONDS_ID)))) || ((ref.getId() == V_Utility.EGGE_BIRD_MONEY_ID)))){
ref.destroyEggeObject();
num = (Math.random() * (birds_types.length - 1));
ref.Update(birds_types[num]);
if (ref.visible){
del = V_Factory.createBird();
del.applyEggeObject(0);
del.calc_x = ref.calc_x;
del.calc_y = ref.calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
bird_top_layer.addChildAt(del, 0);
mas_del_objs.push(del);
};
createDiamonds(ref.getId(), 10, ref.calc_x, ref.calc_y);
flag_clear = false;
continue;
} else {
if (ref.getId() == V_Utility.EGGE_BIRD_CEP_ID){
ref.destroyEggeObject();
num = (Math.random() * (birds_types.length - 1));
ref.applyEggeObject(0);
if (ref.visible){
del = V_Factory.createBird();
del.applyEggeObject(1);
del.calc_x = ref.calc_x;
del.calc_y = ref.calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
bird_top_layer.addChildAt(del, 0);
mas_del_objs.push(del);
};
flag_clear = false;
continue;
};
};
setAnumation(ref, V_Utility.PREPARE_FOR_FLY_ANIM, 1, 1);
mas_del_objs.push(ref);
ref.parent.removeChild(ref);
bird_top_layer.addChild(ref);
count_birds_level = (count_birds_level - 1);
curr_count_checks_birds = (curr_count_checks_birds + 1);
if (((frequency_bonus) && (((curr_count_checks_birds % frequency_bonus) == 0)))){
create_bons = true;
};
if ((((mas_objs[match3[i]].getBonus() >= 0)) && ((mas_objs[match3[i]].getBonus() <= 6)))){
if ((((count_birds_level > 0)) || ((((count_birds_level <= 0)) && ((mas_objs.length > match3.length)))))){
bonuses[mas_objs[match3[i]].getBonus()] = true;
bx = mas_objs[match3[i]].calc_x;
by = mas_objs[match3[i]].calc_y;
bonus_bird = mas_objs[match3[i]].getId();
};
};
};
if (flag_clear){
combo = (combo + 1);
if (combo > 1){
createTextCombo(combo);
};
_event = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_event.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_event.count_birds = match3.length;
_event.combo = combo;
_event.type_bird = (mas_objs[match3[0]].getId() - 1);
dispatchEvent(_event);
egg_pos = (match3.length / 2);
createText((match3.length * 10), mas_objs[match3[egg_pos]].calc_x, mas_objs[match3[egg_pos]].calc_y);
if ((((combo >= 2)) && ((((count_birds_level > 0)) || ((((count_birds_level <= 0)) && ((mas_objs.length > match3.length)))))))){
egg = V_Factory.createBird();
egg.applyDiamond();
egges.push(egg);
bird_top_layer.addChildAt(egg, 0);
egg.calc_x = mas_objs[match3[egg_pos]].calc_x;
egg.calc_y = mas_objs[match3[egg_pos]].calc_y;
rnd_dir = V_Utility.Random_Int(0, 1);
egg.vy = ((2 * rnd_dir) - 1);
egg.vx = -200;
egg.time_bonus_flash = 0.5;
egg.dx = V_Utility.Random_Int(20, 100);
if (!tutorial3.isLearned()){
description_tutor.reset();
description_tutor.show(2);
addChild(description_tutor);
};
};
if ((((match3[0] > 0)) && ((match3[(match3.length - 1)] < (mas_objs.length - 1))))){
mas_objs[match3[(match3.length - 1)]].vy = 1;
checkNodeI(match3[(match3.length - 1)], STATUS_TORMOZ_OBJ, -1, 0, mas_objs[match3[(match3.length - 1)]].vx);
checkNodeD(match3[0], STATUS_TORMOZ_OBJ, mas_objs[match3[0]].dy, 0, mas_objs[match3[0]].vx);
} else {
if (match3[(match3.length - 1)] == (mas_objs.length - 1)){
rid = (mas_objs.length - 1);
checkNodeD(rid, STATUS_TORMOZ_OBJ, mas_objs[rid].dy, 0, mas_objs[rid].vx);
};
};
if (match3[0] > 0){
d = V_Utility.distance(mas_objs[(match3[0] - 1)].calc_x, mas_objs[(match3[0] - 1)].calc_y, mas_objs[match3[0]].calc_x, mas_objs[match3[0]].calc_y);
l_id = mas_objs[(match3[0] - 1)].getId();
if (d <= (V_Utility.DISTANCE_BETWEEN_BIRD + 5)){
if ((((((l_id == V_Utility.EGGE_BIRD_ID)) || ((l_id == V_Utility.EGGE_BIRD_DIAMONDS_ID)))) || ((l_id == V_Utility.EGGE_BIRD_MONEY_ID)))){
mas_objs[(match3[0] - 1)].destroyEggeObject();
num = Math.round((Math.random() * (birds_types.length - 1)));
mas_objs[(match3[0] - 1)].Update(birds_types[num]);
if (mas_objs[(match3[0] - 1)].visible){
del = V_Factory.createBird();
del.applyEggeObject(0);
del.calc_x = mas_objs[(match3[0] - 1)].calc_x;
del.calc_y = mas_objs[(match3[0] - 1)].calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
mas_del_objs.push(del);
bird_top_layer.addChildAt(del, 0);
};
createDiamonds(l_id, 10, mas_objs[(match3[0] - 1)].calc_x, mas_objs[(match3[0] - 1)].calc_y);
} else {
if (l_id == V_Utility.EGGE_BIRD_CEP_ID){
mas_objs[(match3[0] - 1)].destroyEggeObject();
num = Math.round((Math.random() * (birds_types.length - 1)));
mas_objs[(match3[0] - 1)].applyEggeObject(0);
if (mas_objs[(match3[0] - 1)].visible){
del = V_Factory.createBird();
del.applyEggeObject(1);
del.calc_x = mas_objs[(match3[0] - 1)].calc_x;
del.calc_y = mas_objs[(match3[0] - 1)].calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
mas_del_objs.push(del);
bird_top_layer.addChildAt(del, 0);
};
};
};
};
};
if (match3[(match3.length - 1)] < (mas_objs.length - 1)){
d = V_Utility.distance(mas_objs[(match3[(match3.length - 1)] + 1)].calc_x, mas_objs[(match3[(match3.length - 1)] + 1)].calc_y, mas_objs[match3[(match3.length - 1)]].calc_x, mas_objs[match3[(match3.length - 1)]].calc_y);
r_id = mas_objs[(match3[(match3.length - 1)] + 1)].getId();
if (d <= (V_Utility.DISTANCE_BETWEEN_BIRD + 5)){
if ((((((r_id == V_Utility.EGGE_BIRD_ID)) || ((r_id == V_Utility.EGGE_BIRD_DIAMONDS_ID)))) || ((r_id == V_Utility.EGGE_BIRD_MONEY_ID)))){
mas_objs[(match3[(match3.length - 1)] + 1)].destroyEggeObject();
num = Math.round((Math.random() * (birds_types.length - 1)));
mas_objs[(match3[(match3.length - 1)] + 1)].Update(birds_types[num]);
if (mas_objs[(match3[(match3.length - 1)] + 1)].visible){
del = V_Factory.createBird();
del.applyEggeObject(0);
del.calc_x = mas_objs[(match3[(match3.length - 1)] + 1)].calc_x;
del.calc_y = mas_objs[(match3[(match3.length - 1)] + 1)].calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
mas_del_objs.push(del);
bird_top_layer.addChildAt(del, 0);
};
createDiamonds(r_id, 10, mas_objs[(match3[(match3.length - 1)] + 1)].calc_x, mas_objs[(match3[(match3.length - 1)] + 1)].calc_y);
} else {
if (r_id == V_Utility.EGGE_BIRD_CEP_ID){
mas_objs[(match3[(match3.length - 1)] + 1)].destroyEggeObject();
num = Math.round((Math.random() * (birds_types.length - 1)));
mas_objs[(match3[(match3.length - 1)] + 1)].applyEggeObject(0);
if (mas_objs[(match3[(match3.length - 1)] + 1)].visible){
del = V_Factory.createBird();
del.applyEggeObject(1);
del.calc_x = mas_objs[(match3[(match3.length - 1)] + 1)].calc_x;
del.calc_y = mas_objs[(match3[(match3.length - 1)] + 1)].calc_y;
setAnumation(del, V_Utility.EGGE_BIRD_DELETE, 1, 1);
mas_del_objs.push(del);
bird_top_layer.addChildAt(del, 0);
};
};
};
};
};
mas_objs.splice(match3[0], match3.length);
if (bonuses[0]){
applyBonus(0, 0, 0, 0, null);
};
if (bonuses[4]){
applyBonus(4, 0, 0, 0, null);
} else {
if (bonuses[1]){
applyBonus(1, 0, 0, 0, null);
};
};
if (bonuses[2]){
applyBonus(2, bonus_bird, bx, by, null);
};
if (bonuses[3]){
applyBonus(3, -1, bx, by, null);
};
if (bonuses[5]){
applyBonus(5, -1, bx, by, null);
};
if (create_bons){
ceateBonus();
};
};
checkEndGame(last_pos, true);
} else {
if ((((index > 0)) && ((index < (mas_objs.length - 1))))){
if (mas_objs[index].getId() == mas_objs[(index - 1)].getId()){
getInterpolatePoint(mas_objs[index], p1);
getInterpolatePoint(mas_objs[(index - 1)], p2);
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index - 1)]);
if (dist >= (V_Utility.DISTANCE_BETWEEN_BIRD + 3)){
checkNodeD((index - 1), STATUS_NORMAL_OBJ, -1, 0, mas_objs[(index - 1)].vx);
};
} else {
if (mas_objs[index].getId() == mas_objs[(index + 1)].getId()){
getInterpolatePoint(mas_objs[index], p1);
getInterpolatePoint(mas_objs[(index + 1)], p2);
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index + 1)]);
if (dist >= (V_Utility.DISTANCE_BETWEEN_BIRD + 3)){
checkNodeD(index, STATUS_NORMAL_OBJ, -1, 0, mas_objs[(index + 1)].vx);
};
};
};
};
};
};
checkBirdsType();
}
private function clearTextsLayer():void{
var obj:Object;
var dsp:DisplayObject;
while (text_layer.numChildren) {
obj = text_layer.getChildAt(0);
dsp = (obj as DisplayObject);
obj.hide();
if ((obj is V_TextCombo)){
V_Factory.releaseCombo((obj as V_TextCombo));
} else {
if ((obj is V_PointsText)){
V_Factory.releasePointsText((obj as V_PointsText));
};
};
};
}
public function loadLevel(str:String):void{
var str = str;
var url:URLLoader = new URLLoader();
url.dataFormat = URLLoaderDataFormat.BINARY;
url.addEventListener(Event.COMPLETE, loadComplete);
url.addEventListener(IOErrorEvent.IO_ERROR, function (evt:IOErrorEvent):void{
});
url.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (evt:SecurityErrorEvent):void{
});
url.load(new URLRequest(str));
isLoadedLevel = false;
}
public function isCollisionIsTile():int{
var i:int;
var j:int;
var t:Number;
var value:int;
if (shot_obj){
i = int((shot_obj.calc_x / 20));
j = int((shot_obj.calc_y / 20));
value = game_board.getItem(i, j);
if (value == 0){
t = 0;
while (t < 1) {
j = int(((shot_obj.calc_y + ((shot_obj.vy - shot_obj.calc_y) * t)) / 20));
value = game_board.getItem(i, j);
t = (t + 0.25);
if (value == 2){
shot_obj.calc_y = (j * 20);
shot_obj.y = shot_obj.calc_y;
break;
};
};
};
};
return (value);
}
private function loadComplete(evt:Event):void{
var ref_url:URLLoader;
var t:Timer;
var evt = evt;
destroyGame();
if (evt){
ref_url = (evt.currentTarget as URLLoader);
ref_url.removeEventListener(Event.COMPLETE, loadComplete);
ref_url.removeEventListener(IOErrorEvent.IO_ERROR, function (evt:IOErrorEvent):void{
});
ref_url.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, function (evt:SecurityErrorEvent):void{
});
mas_splines.length = 0;
url = (ref_url.data as ByteArray);
} else {
url = bytes_from_embed;
};
url.endian = Endian.LITTLE_ENDIAN;
if (!url){
return;
};
var test:ByteArray = new ByteArray();
test.endian = Endian.BIG_ENDIAN;
url.readBytes(test, 0, 16);
if (url.bytesAvailable > 0){
t = new Timer(1, 0);
t.addEventListener(TimerEvent.TIMER, onLevelBuilding);
t.start();
};
}
private function createText(val:uint, bx:Number, by:Number):void{
var points:V_PointsText = V_Factory.createPointsText();
points.x = bx;
points.y = by;
points.show(val);
text_layer.addChild(points);
}
private function setAnumation(ref:V_Bird, num:int, loop:int, dir:int):void{
ref.setAnimation(num, loop, dir);
}
public function getRandomBirForKatapulta():int{
var i:int;
if (random_for_catapult.length <= 0){
i = 0;
while (i < birds_types.length) {
random_for_catapult.push(birds_types[i]);
i++;
};
};
var num:int;
var pos:int = Math.round((Math.random() * (random_for_catapult.length - 1)));
num = random_for_catapult[pos];
random_for_catapult.splice(pos, 1);
if (katapulta.getNextBird() == num){
pos = (pos + 1);
if (random_for_catapult.length <= 0){
i = 0;
while (i < birds_types.length) {
random_for_catapult.push(birds_types[i]);
i++;
};
};
if (pos >= random_for_catapult.length){
pos = 0;
};
num = random_for_catapult[pos];
};
return (num);
}
public function checkNodeI(index:int, st:int, dy:int, delta:Number, new_speed:Number):void{
var dist:Number;
if (index <= (mas_objs.length - 1)){
dist = 0;
if (index < (mas_objs.length - 1)){
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index + 1)]);
};
mas_objs[index].status = st;
mas_objs[index].Pos = (mas_objs[index].Pos - delta);
mas_objs[index].dy = dy;
mas_objs[index].vx = new_speed;
if (index > 0){
mas_objs[index].vy = mas_objs[(index - 1)].vy;
};
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD + 10)){
checkNodeI((index + 1), st, dy, delta, new_speed);
};
};
}
public function checkNodeD(index:int, st:int, dy:int, delta:Number, new_speed:Number):void{
var dist:Number;
var p:V_SplinePoint;
var d_dist:Number;
var d1:Number;
var ref_prev:V_Bird;
var ref:V_Bird;
var dist2:Number;
if (index >= 0){
dist = 1000;
p = new V_SplinePoint();
if (index > 0){
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index - 1)]);
};
if (index < (mas_objs.length - 1)){
ref_prev = mas_objs[(index + 1)];
ref = mas_objs[index];
dist2 = distanceBetweenObjs(ref_prev, ref);
if (dist2 > V_Utility.DISTANCE_BETWEEN_BIRD){
if ((((ref.dy < 0)) && ((((ref.status == STATUS_NORMAL_OBJ)) || ((ref.status == STATUS_BACK_MOVE_OBJ)))))){
if (dy >= 0){
return;
};
};
};
};
d_dist = 0;
d1 = delta;
mas_objs[index].status = st;
mas_objs[index].Pos = (mas_objs[index].Pos + d1);
mas_objs[index].dy = dy;
mas_objs[index].vx = new_speed;
getInterpolatePoint(mas_objs[index], p);
mas_objs[index].calc_x = p.x;
mas_objs[index].calc_y = p.y;
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD + 3)){
checkNodeD((index - 1), st, dy, d1, new_speed);
};
};
}
public function applyJiterrring(power:Number):void{
jitter_pos = 0;
pp1.x = 0;
pp1.y = 0;
pp2.x = 0;
pp2.y = 0;
pp3.x = 0;
pp3.y = power;
pp4.x = 0;
pp4.y = -(power);
jitter_spline.initSpline(pp1, pp2, pp3, pp4);
}
private function onAdded(evt:Event):void{
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
this.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
this.addEventListener(MouseEvent.MOUSE_WHEEL, onMouse);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
public function checkFreeBird(ref_objs:Array, curr_num:int):Boolean{
var l:int = curr_num;
var r:int = curr_num;
var lf:Boolean;
var rf:Boolean;
if ((((curr_num < 0)) || ((curr_num >= ref_objs.length)))){
return (false);
};
if ((((ref_objs[curr_num].getId() >= V_Utility.EGGE_BIRD_ID)) || ((ref_objs[curr_num].getBonus() >= 0)))){
return (false);
};
while (1) {
if (l >= 0){
if (ref_objs[l].getId() == ref_objs[curr_num].getId()){
l--;
};
};
if (r < ref_objs.length){
if (ref_objs[r].getId() == ref_objs[curr_num].getId()){
r = (r + 1);
};
};
if ((((l < 0)) && ((r >= ref_objs.length)))){
return (true);
};
if ((((((l >= 0)) && ((ref_objs[l].getId() == ref_objs[curr_num].getId())))) && ((ref_objs[l].getBonus() >= 0)))){
return (false);
};
if ((((((r < ref_objs.length)) && ((ref_objs[r].getId() == ref_objs[curr_num].getId())))) && ((ref_objs[r].getBonus() >= 0)))){
return (false);
};
if ((((l >= 0)) && ((r < ref_objs.length)))){
if (((!((ref_objs[l].getId() == ref_objs[curr_num].getId()))) && (!((ref_objs[r].getId() == ref_objs[curr_num].getId()))))){
return (true);
};
} else {
if ((((((l < 0)) && ((r < ref_objs.length)))) && (!((ref_objs[r].getId() == ref_objs[curr_num].getId()))))){
return (true);
};
if ((((((l >= 0)) && ((r >= ref_objs.length)))) && (!((ref_objs[l].getId() == ref_objs[curr_num].getId()))))){
return (true);
};
};
};
return (false);
}
private function onBuildingPath(evt:TimerEvent):void{
var t:Timer;
var b:BitmapData;
var p:V_SplinePoint;
if (mas_splines.length <= 0){
t = (evt.currentTarget as Timer);
t.stop();
t.reset();
t.removeEventListener(TimerEvent.TIMER, onBuildingPath);
isLoadedLevel = true;
b = new BitmapData(800, 600, true, 0);
b.draw(down_tiles);
dwnTiles.bitmapData = b;
b = new BitmapData(800, 600, true, 0);
b.draw(up_tiles);
upTiles.bitmapData = b;
initializeAfterLoaded();
return;
};
var s:V_Spline = mas_splines.shift();
if (lastPoint.x <= -999){
lastPoint.x = -100;
lastPoint.y = -100;
s.calculatePoints(lastPoint, game_path);
} else {
p = game_path.getPoints((game_path.getLength() - 1));
lastPoint.x = p.x;
lastPoint.y = p.y;
s.calculatePoints(lastPoint, game_path);
};
}
private function getInterpolatePoint(curr_ref:V_Bird, curr_point:V_SplinePoint):void{
var point:V_SplinePoint;
var point2:V_SplinePoint;
if (!curr_point){
curr_point = new V_SplinePoint();
};
var p:int = curr_ref.Pos;
var d_pos:Number = (curr_ref.Pos - p);
point = game_path.getPoints(p);
var p1:int = (p + 1);
point2 = game_path.getPoints(p1);
if (point2.x > point.x){
curr_ref.scaleX = -1;
} else {
curr_ref.scaleX = 1;
};
curr_ref.scaleY = 1;
if (V_Utility.distance(point.x, point.y, point2.x, point2.y) >= 2){
curr_ref.visible = false;
} else {
curr_ref.visible = true;
};
curr_point.x = (point.x + ((point2.x - point.x) * d_pos));
curr_point.y = (point.y + ((point2.y - point.y) * d_pos));
}
public function drawEgges(d_time:Number, anim_flag:Boolean):void{
var obj:Object;
var egg:V_Bird;
var dist:Number;
var n:int;
var i:int;
while (i < ps_layer.numChildren) {
obj = ps_layer.getChildAt(i);
obj.update(d_time);
i++;
};
i = 0;
while (i < egges.length) {
egg = egges[i];
if (!flag_pause){
if (anim_flag){
egg.playAnimation();
};
egg.vx = (egg.vx + (300 * d_time));
egg.calc_x = (egg.calc_x + ((egg.dx * d_time) * egg.vy));
egg.calc_y = (egg.calc_y + (egg.vx * d_time));
egg.x = egg.calc_x;
egg.y = egg.calc_y;
egg.time_bonus_flash = (egg.time_bonus_flash - d_time);
if (egg.time_bonus_flash < 0){
egg.time_bonus_flash = 0.05;
};
};
if (egg.calc_x < 10){
egg.vy = 1;
};
if (egg.calc_x > 790){
egg.vy = -1;
};
dist = V_Utility.distance(katapulta.x, katapulta.y, egg.x, egg.y);
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD + 7)){
deleteObject(egg);
n = 0;
if (egg.getId() == 75){
n = (egg.getNumAnim() - 29);
applyEgg(egg.calc_x, egg.calc_y);
} else {
applyMoney(egg.calc_x, egg.calc_y);
};
egges.splice(i, 1);
i--;
} else {
if (egg.calc_y > 650){
deleteObject(egg);
egges.splice(i, 1);
i--;
};
};
i++;
};
}
public function loadFromBytes(bytes:ByteArray):void{
bytes_from_embed = bytes;
loadComplete(null);
}
private function checkConvertEgges(d_time:Number):void{
var i:int;
if (flag_end_game){
return;
};
var flag:Boolean;
var egg:int;
var creations:int;
var step:int;
if (count_diamonds_egg > 0){
calc_time_diamonds_egg = (calc_time_diamonds_egg - d_time);
if (calc_time_diamonds_egg <= 0){
calc_time_diamonds_egg = time_diamonds_egge;
flag = true;
egg = 3;
creations = count_diamonds_egg;
};
};
if (count_moneys_egg > 0){
calc_time_moneys_egg = (calc_time_moneys_egg - d_time);
if (calc_time_moneys_egg <= 0){
calc_time_moneys_egg = time_moneys_egge;
flag = true;
egg = 2;
creations = count_moneys_egg;
};
};
if (((flag) && ((egg > 0)))){
i = 0;
while (i < mas_objs.length) {
step--;
if (mas_objs[i].getId() == V_Utility.EGGE_BIRD_ID){
if (step > 0){
} else {
step = V_Utility.Random_Int(0, 4);
creations--;
mas_objs[i].applyEggeObject(egg);
if (creations <= 0){
return;
};
};
};
i++;
};
};
}
public function calculatePointsAllSplines():void{
game_path.clear();
var last:V_SplinePoint = new V_SplinePoint();
var i:uint;
while (i < mas_splines.length) {
if (i == 0){
last.x = -100;
last.y = -100;
mas_splines[i].calculatePoints(last, game_path);
} else {
last = game_path.getPoints((game_path.getLength() - 1));
mas_splines[i].calculatePoints(last, game_path);
};
i++;
};
}
private function createDiamonds(id:int, count:int, x:Number, y:Number):void{
var rnd_dir:int;
var ddx:Number;
var vx:Number;
var egg:V_Bird;
var creation_count = 10;
if (id == V_Utility.EGGE_BIRD_DIAMONDS_ID){
V_SoundLib.playSound(20);
rnd_dir = V_Utility.Random_Int(0, 1);
ddx = V_Utility.Random_Int(20, 100);
vx = 300;
while (creation_count > 0) {
creation_count--;
egg = V_Factory.createBird();
egg.applyDiamond();
egges.push(egg);
bird_top_layer.addChildAt(egg, 0);
egg.calc_x = x;
egg.calc_y = y;
egg.vy = V_Utility.Random_Float(-1.5, 1.5);
egg.vx = -(V_Utility.Random_Int(200, 400));
egg.time_bonus_flash = 0.5;
egg.dx = ddx;
vx = (vx + 20);
ddx = (ddx + 5);
};
} else {
if ((((id == V_Utility.EGGE_BIRD_MONEY_ID)) || ((id == -1)))){
if (id != -1){
V_SoundLib.playSound(20);
creation_count = 25;
} else {
creation_count = 1;
};
rnd_dir = V_Utility.Random_Int(0, 1);
ddx = V_Utility.Random_Int(20, 100);
vx = 300;
while (creation_count > 0) {
creation_count--;
egg = V_Factory.createBird();
egg.applyMoney();
bird_top_layer.addChildAt(egg, 0);
egg.rotation = V_Utility.Random_Float(0, (Math.PI * 2));
egges.push(egg);
egg.calc_x = x;
egg.calc_y = y;
egg.vy = V_Utility.Random_Float(-1.5, 1.5);
if (id != -1){
egg.vx = -(V_Utility.Random_Int(200, 400));
} else {
egg.vx = -50;
};
egg.time_bonus_flash = 0.75;
egg.dx = ddx;
vx = (vx + 20);
ddx = (ddx + 5);
};
};
};
}
public function good_create():Boolean{
if (sleep_start_time > 0){
return (false);
};
if (((flag_end_game) || (first_flag))){
return (false);
};
if ((((count_birds_level <= 0)) && ((que_objs.length == 0)))){
return (false);
};
if (!mas_objs.length){
return (true);
};
if (mas_objs[(mas_objs.length - 1)].dy < 0){
return (false);
};
if ((((mas_objs.length <= 0)) && (((getTimer() - last_time_reverse_bonus) < 2000)))){
return (false);
};
var ref:V_Bird = mas_objs[(mas_objs.length - 1)];
if (Math.abs((ref.Pos - 0)) >= V_Utility.DISTANCE_BETWEEN_BIRD){
return (true);
};
return (false);
}
private function onLevelBuilding(evt:TimerEvent):void{
var flag:int;
var _local5:int;
var id:int;
var num:int;
var ang:Number;
var s_w:Number;
var s_h:Number;
var xx:Number;
var yy:Number;
var up_level:int;
var collision:int;
var group_id:int;
var ref:V_TileObject;
var p1:V_SplinePoint;
var p2:V_SplinePoint;
var p3:V_SplinePoint;
var p4:V_SplinePoint;
var n_type:int;
var i:int;
var j:int;
var val:int;
var t:Timer;
if (url.position < url.length){
flag = url.readDouble();
switch (flag){
case 1:
_local5 = url.readDouble();
fon.bitmapData = V_Utility.tilesManager.getTile(_local5);
if (!fon.bitmapData){
fon.bitmapData = V_Utility.tilesManager.getTile(20);
};
break;
case 3:
url.readDouble();
hook.x = url.readDouble();
hook.y = url.readDouble();
hook.scaleX = url.readDouble();
hook.scaleY = url.readDouble();
url.readDouble();
break;
case 2:
id = url.readDouble();
num = url.readDouble();
ang = url.readDouble();
s_w = url.readDouble();
s_h = url.readDouble();
xx = url.readDouble();
yy = url.readDouble();
up_level = url.readDouble();
collision = url.readDouble();
group_id = url.readDouble();
ref = new V_TileObject(id, num, xx, yy, ang);
ref.scaleX = s_w;
ref.scaleY = s_h;
ref.rotation = ang;
if (up_level > 0){
up_tiles.addChild(ref);
} else {
down_tiles.addChild(ref);
};
break;
case 4:
p1 = new V_SplinePoint();
p2 = new V_SplinePoint();
p3 = new V_SplinePoint();
p4 = new V_SplinePoint();
p1.x = url.readDouble();
p1.y = url.readDouble();
p2.x = url.readDouble();
p2.y = url.readDouble();
p3.x = url.readDouble();
p3.y = url.readDouble();
p4.x = url.readDouble();
p4.y = url.readDouble();
createSpline(p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y);
break;
case 5:
game_speed = (speed = url.readDouble());
url.readDouble();
break;
case 6:
n_type = url.readDouble();
birds_types.push(n_type);
V_User.birds_id.push(n_type);
break;
case 9:
general_birds_level = (count_birds_level = url.readDouble());
break;
case 10:
url.readDouble();
url.readDouble();
break;
case 11:
i = url.readDouble();
j = url.readDouble();
val = url.readDouble();
game_board.setItem(i, j, val);
break;
case 12:
n_type = url.readDouble();
if (((!((n_type == 2))) && (!((n_type == 5))))){
bonuses_types.push(n_type);
};
break;
case 13:
frequency_bonus = url.readDouble();
frequency_egge_bird = url.readDouble();
max_cepochka_egge_bird = url.readDouble();
if ((((frequency_egge_bird > 0)) || ((max_cepochka_egge_bird > 0)))){
tutorial2.setEgges(true);
} else {
tutorial2.setEgges(false);
};
break;
case 14:
frequency_egge_bird_cep = url.readDouble();
max_cepochka_egge_bird_cep = url.readDouble();
time_moneys_egge = (calc_time_moneys_egg = url.readDouble());
count_moneys_egg = url.readDouble();
time_diamonds_egge = (calc_time_diamonds_egg = url.readDouble());
count_diamonds_egg = url.readDouble();
break;
};
} else {
t = (evt.currentTarget as Timer);
t.stop();
t.reset();
t.removeEventListener(TimerEvent.TIMER, onLevelBuilding);
t.addEventListener(TimerEvent.TIMER, onBuildingPath);
game_path.clear();
lastPoint.x = -1001;
lastPoint.y = -1001;
t.start();
};
}
private function deleteObject(ref:V_Bird):void{
if (((ref) && (ref.parent))){
ref.parent.removeChild(ref);
};
V_Factory.releaseBird((ref as V_Bird));
}
private function onKeyUp(evt:KeyboardEvent):void{
switchBirds();
}
public function moveObjInSpline(anim_flag:Boolean, delta:Number):void{
var ref:V_Bird;
var kx:int;
var p_i:int;
var p_j:int;
var _local22:Number;
var new_st:int;
var ii:int;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:int;
var _local28:Boolean;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:V_EventMatch3;
ref = null;
var ref_prev:V_Bird;
var check_match3_index = -1;
var correct_match3_index = -1;
var insert_obj_index = -1;
var pos_wait_objs = -1;
var flag_flash_complete:Boolean;
var flag_apply_flash_bonus:Boolean;
var correct_flag_for_cm3:Boolean;
var time:Number = 0;
var d_time:Number = delta;
var curr_game_speed:Number = game_speed;
var heightTripleFromKatapulta:Number = 540;
if (katapulta.isTriple()){
kx = (katapulta.x / 20);
heightTripleFromKatapulta = ((game_board.checkNodeY(kx, 0) * 20) + 20);
if (heightTripleFromKatapulta < 0){
heightTripleFromKatapulta = 10;
};
};
cat.setStatus(0);
var i:int;
while (i < mas_objs.length) {
ref = mas_objs[i];
if (i == 0){
if (((((ref.Pos + 200) >= game_path.getLength())) && (!(flag_end_game)))){
cat.setStatus(1);
game_speed = (game_speed / 4);
if (game_speed < 20){
game_speed = 20;
};
} else {
if (((((ref.Pos + 700) >= game_path.getLength())) && (!(flag_end_game)))){
cat.setStatus(1);
game_speed = (game_speed / 2);
if (game_speed < 20){
game_speed = 20;
};
};
};
};
p_i = (ref.calc_x / 20);
p_j = (ref.calc_y / 20);
if (!flag_pause){
ref.checkBonus(d_time);
switch (ref.status){
case STATUS_NORMAL_OBJ:
if (ref.dy < 0){
if (ref.vx < (curr_game_speed * 6)){
ref.vx = (ref.vx + (200 * d_time));
if (ref.vx > (curr_game_speed * 6)){
ref.vx = (curr_game_speed * 6);
};
};
} else {
if (ref.dy > 0){
if (ref.vx > game_speed){
ref.vx = (ref.vx - (300 * d_time));
if (ref.vx < game_speed){
ref.vx = game_speed;
};
} else {
if (ref.vx < game_speed){
ref.vx = (ref.vx + (200 * d_time));
if (ref.vx > game_speed){
ref.vx = game_speed;
};
};
};
} else {
if (i == (mas_objs.length - 1)){
checkNodeD(i, ref.status, 1, 0, ref.vx);
};
};
};
ref.Pos = (ref.Pos + ((ref.vx * d_time) * ref.dy));
break;
case STATUS_START_SPEED:
ref.Pos = (ref.Pos + ((ref.vx * d_time) * ref.dy));
if (i == (mas_objs.length - 1)){
if (mas_objs[0].Pos >= (game_path.getLength() / 10)){
new_st = STATUS_NORMAL_OBJ;
if (!tutorial1.isLearned()){
new_st = STATUS_TORMOZ_OBJ;
description_tutor.reset();
description_tutor.show(0);
addChild(description_tutor);
};
if (!tutorial2.isLearned()){
if (tutorial2.check()){
new_st = STATUS_TORMOZ_OBJ;
description_tutor.reset();
description_tutor.show(1);
addChild(description_tutor);
};
};
ii = 0;
while (ii < mas_objs.length) {
if (mas_objs[ii].status == STATUS_START_SPEED){
mas_objs[ii].status = new_st;
};
ii++;
};
};
};
break;
case STATUS_STEP_BACK_OBJ:
_local22 = ref.vx;
if (_local22 < curr_game_speed){
_local22 = curr_game_speed;
};
if (_local22 > (curr_game_speed * 2)){
_local22 = (curr_game_speed * 2);
};
if (ref.dy >= 0){
ref.Pos = (ref.Pos + ((4 * _local22) * d_time));
} else {
ref.Pos = (ref.Pos + ((2 * _local22) * d_time));
};
if (i == (mas_objs.length - 1)){
checkNodeD(i, STATUS_NORMAL_OBJ, 1, 0, _local22);
};
break;
case STATUS_BACK_MOVE_OBJ:
ref.dy = -1;
ref.Pos = (ref.Pos - (ref.vx * d_time));
if (ref.vx >= 0){
ref.vx = (ref.vx - (800 * d_time));
if (ref.vx < 0){
ref.vx = 0;
ref.dy = 0;
if (ref.vy > 8){
ref.vy = 1;
} else {
if (ref.vy < 1){
ref.vy = 1;
};
};
ref.status = STATUS_WAIT_OBJ;
};
};
break;
case STATUS_TORMOZ_OBJ:
ref.vx = (ref.vx - (450 * d_time));
if (ref.vx < 0){
ref.vx = 0;
ref.dy = 0;
if (ref.vy > 8){
ref.vy = 1;
} else {
if (ref.vy < 1){
ref.vy = 1;
};
};
ref.status = STATUS_WAIT_OBJ;
};
ref.Pos = (ref.Pos + ((ref.vx * d_time) * ref.dy));
break;
case STATUS_BONUS_BACK_MOVE:
ref.vx = (ref.vx - (150 * d_time));
ref.Pos = (ref.Pos - (ref.vx * d_time));
if (ref.vx <= 0){
ref.status = STATUS_WAIT_OBJ;
ref.dy = 0;
if (ref.vy > 8){
ref.vy = 1;
} else {
if (ref.vy < 1){
ref.vy = 1;
};
};
};
break;
case STATUS_BONUS_STOP_MOVE:
ref.vx = (ref.vx - (400 * d_time));
ref.Pos = (ref.Pos + ((ref.vx * d_time) * ((ref.dy)>0) ? 1 : -1));
if (ref.vx <= 0){
ref.vx = 0;
ref.dy = 0;
ref.vy = 8;
ref.status = STATUS_WAIT_OBJ;
};
break;
case STATUS_WAIT_OBJ:
if (!tutorial1.isLearned()){
break;
};
if (((!(tutorial2.isLearned())) && (tutorial2.check()))){
break;
};
if (((!(tutorial3.isLearned())) && (tutorial3.isLockMoving()))){
break;
};
if (((!(tutorial4.isLearned())) && (tutorial4.isLockMoving()))){
break;
};
ref.dy = 0;
if (ref.vy > 8){
ref.vy = 2;
};
ref.vy = (ref.vy - d_time);
if (ref.vy <= 0){
if (i == (mas_objs.length - 1)){
if ((((count_birds_level <= 0)) || ((ref.Pos <= V_Utility.DISTANCE_BETWEEN_BIRD)))){
checkNodeD(i, STATUS_NORMAL_OBJ, 1, 0, ref.vx);
};
};
};
break;
case STATUS_END_SPEED:
ref.vx = (ref.vx + (500 * d_time));
ref.Pos = (ref.Pos + (ref.vx * d_time));
break;
case STATUS_SLOW_SPEED:
if (ref.vx > (game_speed / 4)){
ref.vx = (ref.vx - (200 * d_time));
if (ref.vx < (game_speed / 4)){
ref.vx = (game_speed / 4);
};
} else {
if (ref.vx < (game_speed / 4)){
ref.vx = (ref.vx + (100 * d_time));
if (ref.vx > (game_speed / 4)){
ref.vx = (game_speed / 4);
};
};
};
ref.Pos = (ref.Pos + ((ref.vx * d_time) * ref.dy));
break;
};
};
getInterpolatePoint(ref, point);
if (!ref.inserted){
ref.calc_x = point.x;
ref.calc_y = point.y;
} else {
if (!flag_end_game){
_local23 = ref.x;
_local22 = ref.vx;
if (_local22 < curr_game_speed){
_local22 = curr_game_speed;
};
if (_local22 > (curr_game_speed * 3)){
_local22 = (curr_game_speed * 3);
};
ref.calc_y = (ref.calc_y - ((3 * _local22) * d_time));
if (ref.calc_y < point.y){
ref.calc_y = point.y;
};
if (_local23 < point.x){
ref.calc_x = (ref.calc_x + ((3 * _local22) * d_time));
} else {
if (_local23 > point.x){
ref.calc_x = (ref.calc_x - ((3 * _local22) * d_time));
};
};
if ((((_local23 < point.x)) && ((ref.calc_x > point.x)))){
ref.calc_x = point.x;
};
if ((((_local23 > point.x)) && ((ref.calc_x < point.x)))){
ref.calc_x = point.x;
};
_local24 = V_Utility.distance(point.x, point.y, ref.calc_x, ref.calc_y);
if ((((((ref.calc_x == point.x)) && ((ref.calc_y == point.y)))) || ((_local24 > (V_Utility.DISTANCE_BETWEEN_BIRD * 2))))){
ref.inserted = false;
if (i > 0){
ref.vy = mas_objs[(i - 1)].vy;
};
check_match3_index = i;
};
} else {
ref.calc_x = point.x;
ref.calc_y = point.y;
};
};
if (anim_flag){
ref.playAnimation();
};
if (i > 0){
ref_prev = mas_objs[(i - 1)];
_local25 = 0;
_local26 = 0;
if (ref.status == STATUS_END_SPEED){
if ((getTimer() - lTime) > 600){
V_SoundLib.playSound(4);
lTime = getTimer();
};
};
if ((((((((((ref.status == STATUS_NORMAL_OBJ)) && ((ref.dy >= 0)))) || (!((ref.status == STATUS_NORMAL_OBJ))))) && ((ref_prev.status == STATUS_NORMAL_OBJ)))) && ((ref_prev.dy < 0)))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if ((getTimer() - lTime) > 600){
V_SoundLib.playSound(4);
lTime = getTimer();
};
};
if (((!((ref.status == STATUS_STEP_BACK_OBJ))) && ((ref_prev.status == STATUS_STEP_BACK_OBJ)))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if (_local25 >= (V_Utility.DISTANCE_BETWEEN_BIRD - 3)){
_local26 = (V_Utility.DISTANCE_BETWEEN_BIRD - _local25);
if (_local25 < (V_Utility.DISTANCE_BETWEEN_BIRD + 20)){
checkNodeD((i - 1), ref.status, ref.dy, _local26, ref.vx);
} else {
checkNodeD((i - 1), STATUS_TORMOZ_OBJ, 1, 0, ref.vx);
};
};
};
if (((((!((ref.dy == ref_prev.dy))) || (!((ref.status == ref_prev.status))))) && (((!((ref.status == STATUS_STEP_BACK_OBJ))) && (!((ref_prev.status == STATUS_STEP_BACK_OBJ))))))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if (_local25 <= V_Utility.DISTANCE_BETWEEN_BIRD){
_local26 = (V_Utility.DISTANCE_BETWEEN_BIRD - _local25);
if (ref_prev.dy < 0){
if (check_match3_index < 0){
if (ref.getId() == ref_prev.getId()){
check_match3_index = i;
};
correct_match3_index = i;
correct_flag_for_cm3 = true;
};
} else {
checkNodeD((i - 1), ref.status, ref.dy, _local26, ref.vx);
};
};
};
if (((!((ref.dy == ref_prev.dy))) && ((((ref.status == STATUS_STEP_BACK_OBJ)) && (!((ref_prev.status == STATUS_STEP_BACK_OBJ))))))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if (_local25 <= (V_Utility.DISTANCE_BETWEEN_BIRD - 1)){
if (ref_prev.dy < 0){
if (check_match3_index < 0){
if (ref.getId() == ref_prev.getId()){
check_match3_index = i;
};
correct_match3_index = i;
correct_flag_for_cm3 = true;
};
} else {
_local26 = (V_Utility.DISTANCE_BETWEEN_BIRD - _local25);
checkNodeD((i - 1), ref.status, ref.dy, _local26, ref.vx);
};
};
};
if ((((((ref.status == ref_prev.status)) && ((ref.status == ref_prev.status)))) && (!((ref_prev.status == STATUS_STEP_BACK_OBJ))))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if (_local25 <= (V_Utility.DISTANCE_BETWEEN_BIRD - 2)){
if (ref_prev.dy < 0){
if (check_match3_index < 0){
if (ref.getId() == ref_prev.getId()){
check_match3_index = i;
};
correct_match3_index = i;
correct_flag_for_cm3 = true;
};
} else {
_local26 = (V_Utility.DISTANCE_BETWEEN_BIRD - _local25);
checkNodeD((i - 1), STATUS_STEP_BACK_OBJ, ref.dy, 0, ref.vx);
};
};
};
if (((((((((((((((!(ref.inserted)) && (!(ref_prev.inserted)))) && (!((ref.status == STATUS_STEP_BACK_OBJ))))) && (!((ref_prev.status == STATUS_STEP_BACK_OBJ))))) && (!((ref.status == STATUS_BONUS_BACK_MOVE))))) && (!((ref_prev.status == STATUS_BONUS_BACK_MOVE))))) && (!((ref.status == STATUS_BONUS_STOP_MOVE))))) && (!((ref_prev.status == STATUS_BONUS_STOP_MOVE))))){
_local25 = distanceBetweenObjs(ref, ref_prev);
if (_local25 >= (V_Utility.DISTANCE_BETWEEN_BIRD + 5)){
if ((((ref.getId() == ref_prev.getId())) && ((((ref_prev.dy >= 0)) || (!((ref_prev.status == STATUS_NORMAL_OBJ))))))){
checkNodeD((i - 1), STATUS_NORMAL_OBJ, -1, 0, ref_prev.vx);
};
if ((((ref_prev.dy > 0)) && (((!((ref_prev.status == STATUS_TORMOZ_OBJ))) && (!((ref_prev.status == STATUS_WAIT_OBJ))))))){
checkNodeD((i - 1), STATUS_TORMOZ_OBJ, 1, 0, ref_prev.vx);
};
if (((!((ref.getId() == ref_prev.getId()))) && ((((((ref_prev.dy <= 0)) && (!((ref_prev.status == STATUS_TORMOZ_OBJ))))) && (!((ref_prev.status == STATUS_WAIT_OBJ))))))){
checkNodeD((i - 1), STATUS_TORMOZ_OBJ, ref_prev.dy, 0, ref_prev.vx);
};
};
};
};
if (!flag_pause){
switchAnimations(ref);
};
if (i == 0){
if (((((((ref.Pos + 600) >= game_path.getLength())) && ((ref.dy > 0)))) && (!(flag_end_game)))){
};
if (ref.Pos >= game_path.getLength()){
if (ref.status != STATUS_END_SPEED){
if (!flag_loose){
V_SoundLib.playSound(6);
V_SoundLib.stopMusic(0);
};
flag_loose = true;
_local27 = 0;
while (_local27 < mas_objs.length) {
mas_objs[_local27].status = STATUS_END_SPEED;
_local27++;
};
};
flag_end_game = true;
deleteObject(mas_objs.shift());
i--;
if (mas_objs.length <= 0){
count_birds_level = 0;
que_objs.length = 0;
checkEndGame(0, false);
};
};
};
if (i == (mas_objs.length - 1)){
if ((((ref.status == STATUS_NORMAL_OBJ)) && ((ref.dy == 0)))){
if (count_birds_level <= 0){
ref.dy = 1;
checkNodeD((i - 1), ref.status, ref.dy, 0, ref.vx);
} else {
if (ref.Pos < V_Utility.DISTANCE_BETWEEN_BIRD){
ref.dy = 1;
checkNodeD((i - 1), ref.status, ref.dy, 0, ref.vx);
};
};
} else {
if ((((ref.status == STATUS_NORMAL_OBJ)) && ((ref.dy < 0)))){
checkNodeD(i, STATUS_TORMOZ_OBJ, ref.dy, 0, ref.vx);
};
};
};
if ((((ref.Pos < 0)) && ((ref.dy <= 0)))){
if (ref.status == STATUS_NORMAL_OBJ){
_local26 = (0 - ref.Pos);
ref.dy = -1;
ref.Pos = (ref.Pos + _local26);
ref.status = STATUS_BACK_MOVE_OBJ;
ref.vy = 1;
checkNodeD((i - 1), ref.status, ref.dy, _local26, ref.vx);
} else {
mas_objs.splice(i, 1);
que_objs.push(ref);
if (mas_objs.length <= 0){
};
};
};
ref.x = ref.calc_x;
ref.y = ref.calc_y;
if (((!((game_board.getItem(p_i, p_j) == 3))) && (ref.visible))){
ref.visible = true;
} else {
ref.visible = false;
};
ref.update(d_time);
if ((((((Math.abs((katapulta.x - ref.calc_x)) <= (V_Utility.DISTANCE_BETWEEN_BIRD - 5))) && (ref.visible))) && ((game_board.getItem(p_i, p_j) == 0)))){
if (heightTripleFromKatapulta < ref.calc_y){
heightTripleFromKatapulta = (ref.calc_y + 17);
};
};
if (shot_obj){
if (insert_obj_index == -1){
_local28 = false;
_local29 = 0;
p_i = (ref.calc_x / 20);
p_j = (ref.calc_y / 20);
_local30 = shot_obj.calc_y;
while (_local29 < 1) {
_local31 = (shot_obj.vy - ((shot_obj.vy - shot_obj.calc_y) * _local29));
_local25 = V_Utility.distance(ref.calc_x, ref.calc_y, shot_obj.calc_x, _local31);
if ((((((_local25 <= (V_Utility.DISTANCE_BETWEEN_BIRD + 5))) && (!((game_board.getItem(p_i, p_j) == 3))))) && (ref.visible))){
if (shot_obj.getCurrentFrame() != 65){
shot_obj.y = (shot_obj.calc_y = _local31);
};
if ((isCollisionIsTile() == 0)){
_local28 = true;
break;
};
};
if (shot_obj.getCurrentFrame() != 65){
_local29 = (_local29 + 0.25);
} else {
_local29 = (_local29 + 0.05);
};
};
if (!_local28){
shot_obj.calc_y = _local30;
};
if (_local28){
if (((((((!(flag_end_game)) && ((isCollisionIsTile() == 0)))) && (ref.visible))) && (!((game_board.getItem(p_i, p_j) == 3))))){
if (shot_obj.getCurrentFrame() != 65){
insert_obj_index = i;
if (shot_obj.calc_y < ref.calc_y){
shot_obj.calc_y = ref.calc_y;
};
} else {
if (ref.getId() >= V_Utility.EGGE_BIRD_ID){
if (ref.getId() == V_Utility.EGGE_BIRD_ID){
} else {
if (ref.getId() == V_Utility.EGGE_BIRD_CEP_ID){
};
};
createDiamonds(ref.getId(), 10, ref.calc_x, ref.calc_y);
ref.destroyEggeObject();
ref.Update(getRandomNumBird());
ref.status = STATUS_TORMOZ_OBJ;
setAnumation(ref, V_Utility.MOVE_ANIM, 1, 1);
} else {
count_birds_level = (count_birds_level - 1);
_local32 = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_local32.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_local32.count_birds = 1;
_local32.combo = 1;
_local32.type_bird = (ref.getId() - 1);
dispatchEvent(_local32);
checkNodeD(i, STATUS_TORMOZ_OBJ, ref.dy, 0, ref.vx);
setAnumation(ref, V_Utility.PREPARE_FOR_FLY_ANIM, 1, 1);
mas_del_objs.push(ref);
bird_top_layer.addChild(ref);
mas_objs.splice(i, 1);
i--;
checkEndGame(ref.Pos, true);
};
};
};
};
};
};
i++;
};
game_speed = curr_game_speed;
if (((correct_flag_for_cm3) && (correct_match3_index))){
V_SoundLib.playSound(3);
_local25 = distanceBetweenObjs(mas_objs[correct_match3_index], mas_objs[(correct_match3_index - 1)]);
_local26 = (V_Utility.DISTANCE_BETWEEN_BIRD - _local25);
checkNodeD((correct_match3_index - 1), STATUS_TORMOZ_OBJ, -1, _local26, mas_objs[(correct_match3_index - 1)].vx);
checkNodeI(correct_match3_index, STATUS_TORMOZ_OBJ, -1, 0, mas_objs[(correct_match3_index - 1)].vx);
};
if (((!((check_match3_index == -1))) && ((insert_obj_index == -1)))){
checkMatch3(check_match3_index);
};
if (insert_obj_index != -1){
insertObject(insert_obj_index);
};
if (katapulta.isTriple()){
katapulta.setTripleHeight(heightTripleFromKatapulta);
};
if (!flag_pause){
createObject();
};
}
private function createTextCombo(val:int):void{
var combo:V_TextCombo = V_Factory.createCombo();
combo.show(val);
text_layer.addChild(combo);
combo.x = 400;
combo.y = 250;
val = (val - 2);
if (val > 2){
val = 2;
};
if (val < 0){
return;
};
V_SoundLib.playSound((16 + val));
}
private function createShotObject():void{
var num_bird:int;
var n_id:int;
var num:int = getRandomBirForKatapulta();
if ((((mas_objs.length > 0)) && ((count_birds_level <= 0)))){
num_bird = Math.round((Math.random() * (mas_objs.length - 1)));
num = mas_objs[num_bird].getId();
};
if (num >= V_Utility.EGGE_BIRD_ID){
n_id = Math.round((Math.random() * (birds_types.length - 1)));
num = birds_types[n_id];
};
katapulta.createBird(katapulta.getNextBird());
katapulta.createNextBird(num);
checkBirdsType();
}
public function checkBirdsType():void{
var id_bird:int;
var id_next:int;
var n1:int;
var n2:int;
var c:int;
var f1:Boolean;
var f2:Boolean;
var i:int;
if ((((count_birds_level <= 0)) && ((mas_objs.length > 0)))){
id_bird = katapulta.getIdBird();
id_next = katapulta.getNextBird();
n1 = id_bird;
n2 = id_next;
c = 0;
f1 = false;
f2 = false;
i = 0;
while (i < mas_objs.length) {
if (mas_objs[i].getId() < 9){
if (c == 0){
n1 = mas_objs[i].getId();
n2 = mas_objs[i].getId();
};
c = (c + 1);
if ((c % 2) == 0){
n1 = mas_objs[i].getId();
} else {
n2 = mas_objs[i].getId();
};
if (mas_objs[i].getId() == id_bird){
f1 = true;
};
if (mas_objs[i].getId() == id_next){
f2 = true;
};
if (((f1) && (f2))){
break;
};
};
i++;
};
if (!f1){
katapulta.createBird(n1);
};
if (!f2){
katapulta.createNextBird(n2);
};
};
}
public function calcShotObject(dt:Number):void{
if (shot_obj){
if (shot_obj.getNumAnim() >= 34){
shot_obj.rotation = (shot_obj.rotation - 0);
} else {
shot_obj.vy = shot_obj.calc_y;
shot_obj.rotation = 0;
if (sleep_time >= 1.1){
shot_obj.calc_y = (shot_obj.calc_y - (300 * dt));
} else {
shot_obj.calc_y = (shot_obj.calc_y - ((shot_obj.dx * dt) * 2));
};
};
};
}
public function ceateBonus():void{
var id_bonus:int;
var l:int;
var r:int;
var i:int;
var len:int = (mas_objs.length - 1);
var bonus = -1;
var num_bird = -1;
if ((((len > 0)) && (bonuses_types.length))){
if (bonuses_types_rnd.length <= 0){
i = 0;
while (i < bonuses_types.length) {
bonuses_types_rnd.push(bonuses_types[i]);
i++;
};
};
num_bird = V_Utility.Random_Int(0, len);
id_bonus = V_Utility.Random_Int(0, (bonuses_types_rnd.length - 1));
bonus = bonuses_types_rnd[id_bonus];
bonuses_types_rnd.splice(id_bonus, 1);
l = num_bird;
r = num_bird;
while (1) {
if ((((l < 0)) && ((r >= mas_objs.length)))){
break;
};
if (checkFreeBird(mas_objs, l)){
mas_objs[l].setBonus(bonus);
break;
};
if (((!((l == r))) && (checkFreeBird(mas_objs, r)))){
mas_objs[r].setBonus(bonus);
break;
};
l--;
r = (r + 1);
};
};
}
public function destroyGame():void{
mas_objs.length = 0;
del_egges_bird.length = 0;
mas_del_objs.length = 0;
que_objs.length = 0;
birds_types.length = 0;
mas_splines.length = 0;
bonuses_types.length = 0;
random_for_catapult.length = 0;
random_for_game.length = 0;
isLoadedLevel = false;
game_board.clearBoard();
clearTextsLayer();
while (ps_layer.numChildren) {
ps_layer.removeChildAt(0);
};
while (up_tiles.numChildren) {
V_Factory.releaseBird((up_tiles.removeChildAt(0) as V_Bird));
};
while (down_tiles.numChildren) {
V_Factory.releaseBird((down_tiles.removeChildAt(0) as V_Bird));
};
while (bird_layer.numChildren) {
V_Factory.releaseBird((bird_layer.removeChildAt(0) as V_Bird));
};
while (bird_top_layer.numChildren) {
V_Factory.releaseBird((bird_top_layer.removeChildAt(0) as V_Bird));
};
}
public function drawDelObjs(anim_flag:Boolean, delta:Number):void{
var ref:V_Bird;
var ang:Number;
var i:int;
for (;i < mas_del_objs.length;i++) {
ref = mas_del_objs[i];
if (((!(flag_pause)) && (anim_flag))){
ref.playAnimation();
};
if (ref.getId() >= V_Utility.EGGE_BIRD_ID){
ref.x = ref.calc_x;
ref.y = ref.calc_y;
if (ref.CompleteAnimation()){
deleteObject(ref);
mas_del_objs.splice(i, 1);
i--;
continue;
};
} else {
if ((((ref.getNumAnim() == V_Utility.PREPARE_FOR_FLY_ANIM)) || ((((ref.getNumAnim() >= V_Utility.BLOW1_ANIM)) && ((ref.getNumAnim() <= V_Utility.BLOW4_ANIM)))))){
if (ref.CompleteAnimation()){
setAnumation(ref, V_Utility.FREE_FLY_ANIM, 1, 1);
ang = (-45 + (Math.random() * 90));
ref.vx = Math.sin((ang * V_Utility.IN_RAD));
ref.vy = Math.cos((ang * V_Utility.IN_RAD));
ref.dx = (160 + (Math.random() * 100));
if (ang >= 0){
ref.scaleX = -1;
} else {
ref.scaleX = 1;
};
};
} else {
if (!flag_pause){
ref.calc_x = (ref.calc_x + ((ref.vx * ref.dx) * delta));
ref.calc_y = (ref.calc_y - ((ref.vy * ref.dx) * delta));
ref.x = ref.calc_x;
ref.y = ref.calc_y;
if ((((((ref.calc_y < 0)) || ((ref.calc_x < -50)))) || ((ref.calc_y > 850)))){
mas_del_objs.splice(i, 1);
i--;
deleteObject(ref);
};
};
};
};
};
}
public function drawShotObject(anim_flag:Boolean, delta:Number):void{
var flag:Boolean;
var num_anim:int;
var anim:int;
var d_time:Number = delta;
if (shot_obj != null){
if (!flag_pause){
if (shot_obj.moveFlag){
shot_obj.y = shot_obj.calc_y;
if (anim_flag){
shot_obj.playAnimation();
};
if ((((shot_obj.calc_y < -50)) || ((isCollisionIsTile() == 2)))){
flag = false;
if (((!((shot_obj.getCurrentFrame() == 65))) && ((isCollisionIsTile() == 2)))){
flag = true;
num_anim = (V_Utility.BLOW1_ANIM + Math.round((Math.random() * ((V_Utility.BLOW4_ANIM - V_Utility.BLOW1_ANIM) - 1))));
setAnumation(shot_obj, num_anim, 10, 1);
mas_del_objs.push(shot_obj);
V_SoundLib.playSound(V_Utility.Random_Int(12, 14));
} else {
if (shot_obj.getCurrentFrame() == 65){
if (shot_obj.calc_y < -50){
deleteObject(shot_obj);
flag = true;
};
} else {
deleteObject(shot_obj);
flag = true;
};
};
V_Utility.isRenderToTargetForCurrGame = false;
V_Utility.flag_render_to_target = false;
V_Utility.bird_id = shot_obj.getId();
V_Utility.anim_id = shot_obj.getNumAnim();
V_Utility.rotate = shot_obj.rotation;
if (flag){
shot_obj = null;
createShotObject();
};
};
};
};
if (shot_obj){
if (((shot_obj.CompleteAnimation()) && ((shot_obj.getNumAnim() >= 34)))){
if (!V_Utility.isRenderToTargetForCurrGame){
V_Utility.x = shot_obj.calc_x;
V_Utility.y = shot_obj.calc_y;
V_Utility.flag_render_to_target = true;
V_Utility.bird_id = shot_obj.getId();
V_Utility.anim_id = shot_obj.getNumAnim();
V_Utility.rotate = shot_obj.rotation;
shot_obj.rotation = 0;
dispatchEvent(new Event(V_GameLogic.EVENT_SHOW_FOTO));
this.addChild(foto);
foto.show(1);
};
} else {
if (shot_obj.getNumAnim() >= 34){
shot_obj.rotation = (shot_obj.rotation - (d_time * 0.5));
};
};
if (((shot_obj.CompleteAnimation()) && ((shot_obj.getNumAnim() >= 34)))){
V_Utility.isRenderToTargetForCurrGame = true;
setAnumation(shot_obj, V_Utility.FLY_FROM_KATAPULTA_ANIM, 1, 1);
} else {
if (((shot_obj.CompleteAnimation()) && ((shot_obj.getNumAnim() == V_Utility.FLY_IN_CROWD_ANIM)))){
anim = V_Utility.Random_Int(34, 36);
shot_obj.setAnimation(anim, 6, 1);
V_SoundLib.playSound(1);
shot_obj.scaleX = 1;
};
};
};
};
}
public function checkEndGame(pos:Number, complete:Boolean):void{
if (complete){
if ((((((((count_birds_level <= 0)) && ((mas_objs.length <= 0)))) && ((que_objs.length <= 0)))) && (!(flag_end_game)))){
flag_end_game = true;
dispatchEvent(new Event(V_GameApp.V_GAME_EVENT_HIDE_GAME_INTERFACE));
particle.reset();
particle.Pos = pos;
addChild(particle);
};
} else {
hook.gotoAndStop(2);
flag_end_game = true;
dispatchEvent(new Event(V_GameApp.V_GAME_EVENT_NOCOMPLETE));
};
}
public function distanceBetweenObjs(ref1:V_Bird, ref2:V_Bird):Number{
var res:Number = 0;
res = Math.abs((ref1.Pos - ref2.Pos));
return (res);
}
public function ZommStartGameCamera(d_time:Number):void{
if (flag_start_zoom){
if (sleep_start_time <= 1.5){
cam_scale = (cam_scale - (3 * d_time));
};
if (cam_scale < 1){
cam_scale = 1;
flag_start_zoom = false;
};
cam_x = (-(((800 * cam_scale) - 800)) / 2);
cam_y = -(((600 * cam_scale) - 600));
};
}
public function insertObject(pos:int):void{
var index:int;
var flag_step_back:Boolean;
var collision_obj:V_Bird;
var dist:Number;
if (!tutorial1.isLearned()){
tutorial1.learning();
tutorial4.applyLock();
description_tutor.setDescription(4);
};
if (((!(tutorial2.isLearned())) && (tutorial2.check()))){
tutorial2.learning();
};
V_SoundLib.playSound(0);
if ((((pos >= 0)) && ((pos < mas_objs.length)))){
combo = 0;
index = pos;
flag_step_back = false;
collision_obj = mas_objs[index];
shot_obj.dy = collision_obj.dy;
shot_obj.inserted = true;
shot_obj.status = collision_obj.status;
shot_obj.num_spline = collision_obj.num_spline;
shot_obj.vx = collision_obj.vx;
if (collision_obj.scaleX < 0){
if (shot_obj.x >= collision_obj.x){
shot_obj.Pos = (collision_obj.Pos + V_Utility.DISTANCE_BETWEEN_BIRD);
} else {
if (index < (mas_objs.length - 1)){
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index + 1)]);
if (dist > (V_Utility.DISTANCE_BETWEEN_BIRD * 2)){
shot_obj.Pos = (collision_obj.Pos - V_Utility.DISTANCE_BETWEEN_BIRD);
flag_step_back = true;
} else {
shot_obj.Pos = (mas_objs[(index + 1)].Pos + V_Utility.DISTANCE_BETWEEN_BIRD);
shot_obj.num_spline = mas_objs[(index + 1)].num_spline;
shot_obj.status = mas_objs[(index + 1)].status;
shot_obj.dy = mas_objs[(index + 1)].dy;
shot_obj.vx = mas_objs[(index + 1)].vx;
};
index = (index + 1);
} else {
shot_obj.Pos = (collision_obj.Pos - V_Utility.DISTANCE_BETWEEN_BIRD);
if (index == (mas_objs.length - 1)){
index = (index + 1);
};
};
};
} else {
if (collision_obj.scaleX > 0){
if (shot_obj.x <= collision_obj.x){
shot_obj.Pos = (collision_obj.Pos + V_Utility.DISTANCE_BETWEEN_BIRD);
} else {
if (index < (mas_objs.length - 1)){
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index + 1)]);
if (dist > (V_Utility.DISTANCE_BETWEEN_BIRD * 2)){
shot_obj.Pos = (collision_obj.Pos - V_Utility.DISTANCE_BETWEEN_BIRD);
flag_step_back = true;
} else {
shot_obj.Pos = (mas_objs[(index + 1)].Pos + V_Utility.DISTANCE_BETWEEN_BIRD);
shot_obj.num_spline = mas_objs[(index + 1)].num_spline;
shot_obj.status = mas_objs[(index + 1)].status;
shot_obj.dy = mas_objs[(index + 1)].dy;
shot_obj.vx = mas_objs[(index + 1)].vx;
};
index = (index + 1);
} else {
shot_obj.Pos = (collision_obj.Pos - V_Utility.DISTANCE_BETWEEN_BIRD);
if (index == (mas_objs.length - 1)){
index = (index + 1);
};
};
};
};
};
if (shot_obj.Pos < 0){
shot_obj.Pos = 0;
};
mas_objs.splice(index, 0, shot_obj);
bird_layer.addChild(shot_obj);
setAnumation(shot_obj, V_Utility.FLY_IN_CROWD_ANIM, 1, 1);
if (index > 0){
dist = distanceBetweenObjs(mas_objs[index], mas_objs[(index - 1)]);
if ((((dist <= 36)) && (!(flag_step_back)))){
checkNodeD((index - 1), STATUS_STEP_BACK_OBJ, collision_obj.dy, 0, mas_objs[index].vx);
};
};
shot_obj = null;
createShotObject();
};
}
public function createObject():void{
var num:int;
var curr_speed:Number;
var flag_queue:Boolean;
var ref:V_Bird;
var dist:Number;
if (good_create()){
num = 0;
curr_speed = game_speed;
flag_queue = false;
ref = null;
if (que_objs.length == 0){
if (cepochka <= 0){
num = getRandomBirdForGame();
if (cepochka <= -1){
cepochka = (0 + Math.round((Math.random() * 4)));
};
} else {
if (mas_objs.length > 0){
num = mas_objs[(mas_objs.length - 1)].getId();
} else {
num = getRandomBirdForGame();
};
};
cepochka = (cepochka - 1);
ref = V_Factory.createBird();
if (num < V_Utility.EGGE_BIRD_ID){
ref.Update(num);
} else {
if (num == V_Utility.EGGE_BIRD_CEP_ID){
ref.applyEggeObject(1);
} else {
ref.applyEggeObject(0);
};
};
} else {
flag_queue = true;
ref = que_objs.pop();
};
setAnumation(ref, V_Utility.MOVE_ANIM, 1, 1);
ref.Pos = 0;
ref.dx = 0;
ref.dy = 1;
ref.inserted = false;
ref.calc_scale = (ref.scaleX = (ref.scaleY = 0.5));
dist = 0;
if (!mas_objs.length){
ref.Pos = 0;
if ((getTimer() - last_time_reverse_bonus) <= 3000){
ref.status = STATUS_NORMAL_OBJ;
ref.vx = curr_speed;
} else {
ref.status = STATUS_START_SPEED;
ref.vx = (curr_speed * 5);
};
} else {
dist = (mas_objs[(mas_objs.length - 1)].Pos - ref.Pos);
if (dist <= (V_Utility.DISTANCE_BETWEEN_BIRD * 2)){
ref.Pos = (ref.Pos + (dist - V_Utility.DISTANCE_BETWEEN_BIRD));
ref.status = mas_objs[(mas_objs.length - 1)].status;
ref.dy = mas_objs[(mas_objs.length - 1)].dy;
ref.vx = mas_objs[(mas_objs.length - 1)].vx;
ref.time_bonus_flash = mas_objs[(mas_objs.length - 1)].time_bonus_flash;
} else {
ref.vx = curr_speed;
ref.status = STATUS_NORMAL_OBJ;
if ((((mas_objs[(mas_objs.length - 1)].getId() == ref.getId())) && ((mas_objs[(mas_objs.length - 1)].dy >= 0)))){
mas_objs[(mas_objs.length - 1)].status = STATUS_NORMAL_OBJ;
mas_objs[(mas_objs.length - 1)].dy = -1;
checkNodeD((mas_objs.length - 1), STATUS_NORMAL_OBJ, -1, 0, mas_objs[(mas_objs.length - 1)].vx);
};
};
};
getInterpolatePoint(ref, p);
ref.x = p.x;
ref.y = p.y;
ref.vy = 0;
ref.num_spline = -1;
if (!flag_queue){
curr_count_birds_level = (curr_count_birds_level + 1);
if ((((((frequency_egge_bird_cep > 0)) && (((curr_count_birds_level % frequency_egge_bird_cep) == 0)))) && ((max_cepochka_egge_bird_cep > 0)))){
cepochka = (cepochka = (1 + Math.round((Math.random() * max_cepochka_egge_bird_cep))));
ref.applyEggeObject(1);
cepochka = (cepochka - 1);
} else {
if ((((((frequency_egge_bird > 0)) && (((curr_count_birds_level % frequency_egge_bird) == 0)))) && ((max_cepochka_egge_bird > 0)))){
cepochka = (cepochka = (1 + Math.round((Math.random() * max_cepochka_egge_bird_cep))));
ref.applyEggeObject(0);
cepochka = (cepochka - 1);
};
};
};
if (!tutorial1.isLearned()){
if (mas_objs.length < 2){
ref.Update(katapulta.getIdBird());
katapulta.createNextBird(ref.getId());
cepochka = -1;
};
};
if (((!(tutorial2.isLearned())) && (tutorial2.check()))){
if (mas_objs.length < 2){
ref.Update(katapulta.getIdBird());
katapulta.createNextBird(ref.getId());
cepochka = -1;
} else {
if (mas_objs.length == 2){
cepochka = -1;
ref.applyEggeObject(0);
};
};
};
if (mas_objs.length == 0){
V_SoundLib.playSound(5);
};
mas_objs.push(ref);
bird_layer.addChild(ref);
};
}
public function getRandomNumBird():int{
var id:int;
var n_type = 1;
if (birds_types.length > 0){
id = V_Utility.Random_Int(0, (birds_types.length - 1));
n_type = birds_types[id];
};
return (n_type);
}
private function initializeAfterLoaded():void{
katapulta.x = 400;
katapulta.y = 560;
var num:int = getRandomBirForKatapulta();
katapulta.createNextBird(num);
V_Utility.isRenderToTargetForCurrGame = false;
V_Utility.back1 = dwnTiles.bitmapData;
V_Utility.back2 = upTiles.bitmapData;
V_Utility.back3 = fon.bitmapData;
foto.reset();
particle.reset();
addChild(particle);
flag_loose = false;
cat.reset();
num = getRandomBirForKatapulta();
katapulta.createBird(num);
katapulta.setFlagTriple(false);
cam_scale = 1;
flag_start_zoom = true;
sleep_start_time = 3;
flag_pause = false;
flag_end_game = false;
first_flag = true;
hook.gotoAndStop(1);
dispatchEvent(new Event(EVENT_LOADED_LEVEL));
}
private function JiteringCamera(delta:Number):void{
var p:V_SplinePoint;
if ((((((jitter_pos < 1)) && (!(flag_pause)))) && ((sleep_time <= 1)))){
jitter_pos = (jitter_pos + (4 * delta));
if (jitter_pos > 1){
jitter_pos = 1;
if (Math.abs(jitter_spline.getA1ControlPoint().y) >= 15){
applyJiterrring((jitter_spline.getA1ControlPoint().y / 2));
};
};
p = jitter_spline.getPoint(jitter_pos);
cam_x = p.x;
cam_y = p.y;
};
}
private function updateTextObs(dt:Number):void{
var obj:Object;
var dsp:DisplayObject;
var i:uint;
while (i < text_layer.numChildren) {
obj = text_layer.getChildAt(i);
dsp = (obj as DisplayObject);
obj.update(dt);
if (((dsp) && ((dsp.alpha <= 0)))){
obj.hide();
if ((obj is V_TextCombo)){
V_Factory.releaseCombo((obj as V_TextCombo));
} else {
if ((obj is V_PointsText)){
V_Factory.releasePointsText((obj as V_PointsText));
};
};
};
i++;
};
}
public function applyBonus(bonus:int, type:int, bx:Number, by:Number, ref_bird:V_Bird):void{
var flag:Boolean;
var i:int;
var ref:V_Bird;
var curr:V_Bird;
var pos:int;
var _event:V_EventMatch3;
var p:V_BoomParticle;
var dist:Number;
var del:V_Bird;
trace("apply bonus ", bonus);
switch (bonus){
case 0:
V_SoundLib.playSound(10);
katapulta.setFlagTriple(true);
break;
case 1:
flag = false;
i = 0;
while (i < mas_objs.length) {
ref = mas_objs[i];
ref.status = STATUS_BONUS_BACK_MOVE;
if (ref.vx < (game_speed * 4)){
ref.vx = (game_speed * 4);
};
if (ref.vx < 320){
ref.vx = 320;
};
ref.vy = 1;
ref.dy = -1;
flag = true;
i++;
};
if (flag){
last_time_reverse_bonus = getTimer();
};
V_SoundLib.playSound(11);
break;
case 2:
curr = null;
flag = false;
i = 0;
while (i < mas_objs.length) {
curr = mas_objs[i];
if (curr.getId() == type){
flag = true;
};
i++;
};
if (!flag){
i = 0;
while (i < mas_objs.length) {
curr = mas_objs[i];
curr.num_spline = -1;
i++;
};
};
break;
case 22:
curr = null;
flag = true;
pos = -1;
i = 0;
while (i < mas_objs.length) {
curr = mas_objs[i];
curr.num_spline = 0;
if (curr == ref_bird){
if (flag){
applyJiterrring(20);
};
flag = false;
if (pos == -1){
pos = curr.Pos;
};
count_birds_level = (count_birds_level - 1);
_event = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_event.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_event.count_birds = 1;
_event.combo = 1;
_event.type_bird = (curr.getId() - 1);
dispatchEvent(_event);
checkNodeD(i, STATUS_TORMOZ_OBJ, curr.dy, 0, curr.vx);
setAnumation(curr, V_Utility.PREPARE_FOR_FLY_ANIM, 1, 1);
mas_del_objs.push_back(curr);
mas_objs.splice(i, 1);
i--;
break;
};
i++;
};
checkBirdsType();
checkEndGame(pos, true);
break;
case 3:
V_SoundLib.playSound(8);
applyJiterrring(100);
p = new V_BoomParticle();
ps_layer.addChild(p);
p.x = bx;
p.y = by;
p.scaleX = (p.scaleY = 3);
i = 0;
while (i < mas_objs.length) {
curr = mas_objs[i];
dist = V_Utility.distance(bx, by, curr.x, curr.y);
if (dist < 150){
checkNodeD(i, STATUS_TORMOZ_OBJ, mas_objs[i].dy, 0, mas_objs[i].vx);
if (curr.getId() >= V_Utility.EGGE_BIRD_ID){
if (curr.getId() == V_Utility.EGGE_BIRD_CEP_ID){
del = V_Factory.createBird();
del.applyEggeObject(1);
del.calc_x = curr.calc_x;
del.calc_y = curr.calc_y;
del.setAnimation(V_Utility.EGGE_BIRD_CEP_DELETE, 1, 1);
del_egges_bird.push(del);
} else {
createDiamonds(curr.getId(), 10, curr.x, curr.y);
curr.destroyEggeObject();
curr.Update(getRandomNumBird());
curr.status = STATUS_TORMOZ_OBJ;
setAnumation(curr, V_Utility.MOVE_ANIM, 1, 1);
};
} else {
count_birds_level = (count_birds_level - 1);
_event = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_event.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_event.count_birds = 1;
_event.combo = 1;
_event.type_bird = (curr.getId() - 1);
dispatchEvent(_event);
setAnumation(curr, V_Utility.PREPARE_FOR_FLY_ANIM, 1, 1);
mas_del_objs.push(curr);
mas_objs.splice(i, 1);
i--;
};
};
i++;
};
checkBirdsType();
break;
case 4:
V_SoundLib.playSound(9);
i = 0;
while (i < mas_objs.length) {
ref = mas_objs[i];
ref.vy = 8;
ref.status = STATUS_BONUS_STOP_MOVE;
if (ref.dy > 1){
ref.dy = 1;
};
i++;
};
break;
case 5:
katapulta.applyCoreBonus();
break;
};
}
public function render(dt:Number):void{
var old_time:Number;
var sleep_anim_d_time:Number;
var anim_flag:Boolean;
var nx:Number;
if (flag_pause){
return;
};
if (isLoadedLevel){
if (!tutorial1.isLearned()){
if (tutorial1.isLockMoving()){
nx = tutorial1.getNewXForKtapulta();
if (nx != -1){
katapulta.x = (nx + 9);
};
description_tutor.shadow.x = katapulta.x;
};
};
if (!tutorial2.isLearned()){
if (tutorial2.isLockMoving()){
nx = tutorial2.getNewXForKtapulta();
if (nx != -1){
katapulta.x = (nx + 9);
};
description_tutor.shadow.x = katapulta.x;
};
};
if (!tutorial3.isLearned()){
if (tutorial3.isLockMoving()){
nx = tutorial3.getNewXForKtapulta();
if (nx != -1){
katapulta.x = (nx + 12);
};
description_tutor.shadow.x = katapulta.x;
};
};
if (!tutorial4.isLearned()){
if (tutorial4.isLockMoving()){
nx = description_tutor.shadow.x;
if (nx != -1){
katapulta.x = nx;
};
description_tutor.shadow.x = katapulta.x;
};
};
drawParticle(dt);
V_User.time_level = (V_User.time_level + dt);
if (sleep_start_time > 0){
sleep_start_time = (sleep_start_time - dt);
if (sleep_start_time <= 0){
V_SoundLib.playSound(27);
};
};
old_time = dt;
sleep_anim_d_time = dt;
dt = (dt / sleep_time);
if (sleep_time > 1){
sleep_anim_d_time = (sleep_anim_d_time / 2);
};
anim_sleep = (anim_sleep - sleep_anim_d_time);
anim_flag = false;
if (anim_sleep <= 0){
anim_sleep = 0.04;
anim_flag = true;
};
checkSleepTime(old_time);
ZoomSleemTimeCamera(old_time);
ZommStartGameCamera(old_time);
JiteringCamera(old_time);
this.x = cam_x;
this.y = cam_y;
this.scaleX = (this.scaleY = cam_scale);
checkConvertEgges(dt);
calcShotObject(dt);
moveObjInSpline(anim_flag, dt);
katapulta.update(dt);
updateTextObs(dt);
drawDelObjs(anim_flag, dt);
drawShotObject(anim_flag, dt);
drawEgges(dt, anim_flag);
foto.update(old_time);
cat.update(old_time);
description_tutor.update(dt);
};
}
public function applyEgg(x:Number, y:Number):void{
var _event:V_EventMatch3 = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_event.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_event.count_birds = 1;
_event.combo = 5;
_event.type_bird = 8;
dispatchEvent(_event);
if (!tutorial3.isLearned()){
tutorial3.learning();
description_tutor.hide();
};
createText(50, x, y);
var p:V_CatchParticle = new V_CatchParticle();
p.x = x;
p.y = y;
ps_layer.addChild(p);
V_SoundLib.playSound(7);
}
public function set Pause(val:Boolean):void{
flag_pause = val;
}
private function switchAnimations(ref:V_Bird):void{
var loop:int;
var num:int = ref.getNumAnim();
if (ref.getId() == V_Utility.EGGE_BIRD_ID){
if (ref.dy == 0){
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_STOP){
setAnumation(ref, V_Utility.EGGE_BIRD_STOP, 1, 1);
};
} else {
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_MOVE){
setAnumation(ref, V_Utility.EGGE_BIRD_MOVE, 1, 1);
};
};
return;
} else {
if (ref.getId() == V_Utility.EGGE_BIRD_CEP_ID){
if (ref.dy == 0){
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_CEP_STOP){
setAnumation(ref, V_Utility.EGGE_BIRD_CEP_STOP, 1, 1);
};
} else {
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_CEP_MOVE){
setAnumation(ref, V_Utility.EGGE_BIRD_CEP_MOVE, 1, 1);
};
};
return;
} else {
if (ref.getId() == V_Utility.EGGE_BIRD_MONEY_ID){
if (ref.dy == 0){
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_MONEY_STOP){
setAnumation(ref, V_Utility.EGGE_BIRD_MONEY_STOP, 1, 1);
};
} else {
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_MONEY_MOVE){
setAnumation(ref, V_Utility.EGGE_BIRD_MONEY_MOVE, 1, 1);
};
};
return;
} else {
if (ref.getId() == V_Utility.EGGE_BIRD_DIAMONDS_ID){
if (ref.dy == 0){
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_DIAMOND_STOP){
setAnumation(ref, V_Utility.EGGE_BIRD_DIAMOND_STOP, 1, 1);
};
} else {
if (ref.getNumAnim() != V_Utility.EGGE_BIRD_DIAMOND_MOVE){
setAnumation(ref, V_Utility.EGGE_BIRD_DIAMOND_MOVE, 1, 1);
};
};
return;
};
};
};
};
if (num == V_Utility.FLY_IN_CROWD_ANIM){
if (ref.CompleteAnimation()){
if (ref.dy == 0){
setAnumation(ref, V_Utility.STOP_ANIM, 1, 1);
} else {
setAnumation(ref, V_Utility.MOVE_ANIM, 1, 1);
};
};
} else {
if (ref.dy == 0){
if (num == V_Utility.MOVE_ANIM){
setAnumation(ref, V_Utility.IDL_ANIM, V_Utility.Random_Int(10, 60), 1);
} else {
if (num == V_Utility.STOP_ANIM){
if (ref.CompleteAnimation()){
setAnumation(ref, V_Utility.IDL_ANIM, V_Utility.Random_Int(10, 60), 1);
};
} else {
if (num == V_Utility.DIGIT_ANIM){
} else {
if (num == V_Utility.IDL_ANIM){
if (ref.CompleteAnimation()){
num = V_Utility.Random_Int(3, 6);
loop = 1;
switch (num){
case 3:
loop = V_Utility.Random_Int(1, 3);
break;
case 4:
loop = V_Utility.Random_Int(1, 3);
break;
case 5:
loop = V_Utility.Random_Int(2, 3);
break;
case 6:
loop = V_Utility.Random_Int(1, 2);
break;
};
setAnumation(ref, num, loop, 1);
};
} else {
if (ref.CompleteAnimation()){
setAnumation(ref, V_Utility.IDL_ANIM, V_Utility.Random_Int(10, 60), 1);
};
};
};
};
};
} else {
if (ref.dy != 0){
if (((!((num == V_Utility.MOVE_ANIM))) && (!((num == V_Utility.FLY_IN_CROWD_ANIM))))){
setAnumation(ref, V_Utility.MOVE_ANIM, 1, 1);
};
};
};
};
}
public function ZoomSleemTimeCamera(d_time:Number):void{
if (sleep_time > 1){
cam_scale = (0.3 + ((sleep_time / MAX_SLEEP_TIME) * 2.4));
if (cam_scale > 3){
cam_scale = 3;
};
if (cam_scale < 1){
cam_scale = 1;
};
if (shot_obj){
val1 = (shot_obj.calc_x / 800);
val2 = (shot_obj.calc_y / 600);
};
cam_x = (-(((800 * cam_scale) - 800)) * val1);
cam_y = (-(((600 * cam_scale) - 600)) * val2);
} else {
if ((((((cam_scale > 1)) && (!(flag_start_zoom)))) && ((sleep_time < 1)))){
cam_scale = (0.3 + ((sleep_time / MAX_SLEEP_TIME) * 2.4));
if (shot_obj){
val1 = (shot_obj.calc_x / 800);
val2 = (shot_obj.calc_y / 600);
};
if (cam_scale < 1){
cam_scale = 1;
};
cam_x = (-(((800 * cam_scale) - 800)) * val1);
cam_y = (-(((600 * cam_scale) - 600)) * val2);
};
};
}
public function get Pause():Boolean{
return (flag_pause);
}
public function createSpline(f_x1:Number, f_y1:Number, f_x2:Number, f_y2:Number, f_x3:Number, f_y3:Number, f_x4:Number, f_y4:Number):void{
var first:V_SplinePoint = new V_SplinePoint();
var last:V_SplinePoint = new V_SplinePoint();
var anch1:V_SplinePoint = new V_SplinePoint();
var anch2:V_SplinePoint = new V_SplinePoint();
first.x = f_x1;
first.y = f_y1;
last.x = f_x2;
last.y = f_y2;
anch1.x = f_x3;
anch1.y = f_y3;
anch2.x = f_x4;
anch2.y = f_y4;
var ref:V_Spline = new V_Spline();
ref.initSpline(first, last, anch1, anch2);
mas_splines.push(ref);
}
public function getRandomBirdForGame():int{
var i:int;
if (random_for_game.length <= 0){
i = 0;
while (i < birds_types.length) {
random_for_game.push(birds_types[i]);
i++;
};
};
var num:int;
var pos:int = Math.round((Math.random() * (random_for_game.length - 1)));
num = random_for_game[pos];
random_for_game.splice(pos, 1);
return (num);
}
public function drawParticle(dt:Number):void{
var p:V_SplinePoint;
if ((((sleep_start_time <= 0)) && (first_flag))){
particle.Pos = (particle.Pos + (1000 * dt));
if (particle.Pos > game_path.getLength()){
particle.Pos = game_path.getLength();
first_flag = false;
particle.creation = false;
} else {
p = game_path.getPoints(particle.Pos);
particle.cx = p.x;
particle.cy = (p.y + 5);
};
} else {
if (((flag_end_game) && (particle.parent))){
particle.Pos = (particle.Pos + (1000 * dt));
katapulta.x = -100;
if (particle.Pos > game_path.getLength()){
particle.Pos = game_path.getLength();
particle.creation = false;
} else {
p = game_path.getPoints(particle.Pos);
particle.cx = p.x;
particle.cy = (p.y + 5);
if ((particle.Pos - particle.oldP) > 50){
particle.oldP = particle.Pos;
createDiamonds(-1, 1, p.x, p.y);
V_User.points = (V_User.points + 5);
createText(5, p.x, p.y);
V_SoundLib.playSound(15);
};
};
};
};
particle.update(dt);
if (((((((((((((!(particle.parent)) && ((mas_objs.length == 0)))) && ((que_objs.length == 0)))) && ((egges.length == 0)))) && ((mas_del_objs.length == 0)))) && ((count_birds_level <= 0)))) && (!(flag_loose)))){
dispatchEvent(new Event(V_GameApp.V_GAME_EVENT_COMPLETE));
};
}
public function applyMoney(x:Number, y:Number):void{
var _event:V_EventMatch3 = new V_EventMatch3(V_GameApp.V_GAME_EVENT_CHECK_MATCH3);
_event.time_value = ((general_birds_level - count_birds_level) / general_birds_level);
_event.count_birds = 5;
_event.combo = 1;
_event.type_bird = 9;
dispatchEvent(_event);
createText(5, x, y);
V_SoundLib.playSound(15);
}
}
}//package
Section 93
//V_GameOverRes (V_GameOverRes)
package {
import flash.display.*;
public dynamic class V_GameOverRes extends MovieClip {
public var yes_btn:SimpleButton;
public var no_btn:SimpleButton;
}
}//package
Section 94
//V_GameOverWnd (V_GameOverWnd)
package {
import flash.events.*;
public class V_GameOverWnd extends V_GameOverRes implements V_IWindow {
private var flag:Boolean;// = false
public static var EVENT_EXIT_GAME:String = "EVENT_EXIT_GAME";
public function V_GameOverWnd(){
super();
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
no_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
yes_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
no_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
}
public function update(dt:Number):void{
if (flag){
if (this.alpha < 1){
this.alpha = (this.alpha + (dt * 5));
};
} else {
if (this.alpha > 0){
this.alpha = (this.alpha - (dt * 5));
} else {
if (this.parent){
this.parent.removeChild(this);
};
};
};
}
public function hide():void{
flag = false;
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
V_SoundLib.playSound(25);
switch (evt.currentTarget.name){
case yes_btn.name:
dispatchEvent(new Event(V_PauseWnd.EVENT_RESTART_LEVEL));
break;
case no_btn.name:
dispatchEvent(new Event(EVENT_EXIT_GAME));
break;
};
}
public function show():void{
flag = true;
this.alpha = 0;
V_SoundLib.playSound(22);
}
}
}//package
Section 95
//V_Gui (V_Gui)
package {
import flash.events.*;
import flash.display.*;
public class V_Gui extends Sprite {
private var windows:Array;
private var gameover:V_GameOverWnd;
private var loader:V_LoaderWnd;
private var finish:V_FinishWnd;
private var menu:V_MenuWnd;
private var statistics:V_Statistics;
private var options:V_OptionsWnd;
private var interface_wnd:V_IntrefaceWnd;
private var start_game:V_StartGameWnd;
private var flash:V_SplashWnd;
private var pause:V_PauseWnd;
public static const SCORE_WND:uint = 5;
public static const FINISH_WND:uint = 6;
public static const PAUSE_WND:uint = 2;
public static const FLASH_WND:uint = 7;
public static const INTERFACE_WND:uint = 1;
public static const OPTIONS_WND:uint = 4;
public static const MENU_WND:uint = 0;
public static const GAME_OVER_WND:uint = 3;
public static const LOADER_WND:uint = 9;
public static const START_GAME_WND:uint = 8;
public function V_Gui(){
super();
windows = new Array();
menu = new V_MenuWnd();
menu.addEventListener(V_MenuWnd.EVENT_START_PLAY_GAME, onGuiListener);
windows.push(menu);
interface_wnd = new V_IntrefaceWnd();
interface_wnd.addEventListener(V_IntrefaceWnd.EVENT_PAUSE, onGuiListener);
windows.push(interface_wnd);
pause = new V_PauseWnd();
pause.addEventListener(V_IntrefaceWnd.EVENT_PAUSE, onGuiListener);
pause.addEventListener(V_PauseWnd.EVENT_RESTART_LEVEL, onGuiListener);
pause.addEventListener(V_PauseWnd.EVENT_SHOW_OPTIONS, onGuiListener);
windows.push(pause);
gameover = new V_GameOverWnd();
gameover.addEventListener(V_PauseWnd.EVENT_RESTART_LEVEL, onGuiListener);
gameover.addEventListener(V_GameOverWnd.EVENT_EXIT_GAME, onGuiListener);
windows.push(gameover);
options = new V_OptionsWnd();
windows.push(options);
statistics = new V_Statistics();
statistics.addEventListener(V_MenuWnd.EVENT_START_PLAY_GAME, onGuiListener);
windows.push(statistics);
finish = new V_FinishWnd();
windows.push(finish);
flash = new V_SplashWnd();
windows.push(flash);
start_game = new V_StartGameWnd();
windows.push(start_game);
loader = new V_LoaderWnd();
windows.push(loader);
}
public function hide(num:int):void{
var wnd:V_IWindow = (windows[num] as V_IWindow);
if (!wnd){
return;
};
wnd.hide();
}
public function update(dt:Number):void{
var ref_wnd:V_IWindow;
var i:uint;
while (i < numChildren) {
ref_wnd = (getChildAt(i) as V_IWindow);
ref_wnd.update(dt);
i++;
};
}
public function getRfeWindow(num:int):V_IWindow{
return (windows[num]);
}
private function onGuiListener(evt:Event):void{
dispatchEvent(evt);
switch (evt.type){
case V_PauseWnd.EVENT_SHOW_OPTIONS:
show(OPTIONS_WND);
break;
case V_GameOverWnd.EVENT_EXIT_GAME:
show(FINISH_WND);
break;
};
}
public function show(num:int):void{
var wnd:V_IWindow = (windows[num] as V_IWindow);
if (!wnd){
return;
};
wnd.show();
addChild((wnd as DisplayObject));
}
public function hideAll():void{
while (numChildren) {
removeChildAt(0);
};
}
}
}//package
Section 96
//V_Hook (V_Hook)
package {
import flash.display.*;
public dynamic class V_Hook extends MovieClip {
}
}//package
Section 97
//V_InterfaceRes (V_InterfaceRes)
package {
import flash.display.*;
public dynamic class V_InterfaceRes extends MovieClip {
public var diamonds_mc:V_BirdItem;
public var b1:V_BirdItem;
public var b2:V_BirdItem;
public var pause_btn:SimpleButton;
public var progress_mc:MovieClip;
public var b3:V_BirdItem;
public var b4:V_BirdItem;
public var moneys_mc:V_BirdItem;
public var b5:V_BirdItem;
public var b6:V_BirdItem;
}
}//package
Section 98
//V_IntrefaceWnd (V_IntrefaceWnd)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class V_IntrefaceWnd extends V_InterfaceRes implements V_IWindow {
private var dsty:Number;// = 0
private var sleep:Number;// = 0
public static const EVENT_PAUSE:String = "EVENT_PAUSE";
public function V_IntrefaceWnd(){
var ref:V_BirdItem;
super();
progress_mc.visible = false;
pause_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
pause_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
moneys_mc.points_txt.autoSize = TextFieldAutoSize.LEFT;
moneys_mc.bird_mc.gotoAndStop(10);
diamonds_mc.bird_mc.gotoAndStop(9);
var i:uint = 1;
while (i < 7) {
ref = (getChildByName(("b" + i.toString())) as V_BirdItem);
ref.bird_mc.gotoAndStop(11);
ref.visible = false;
i++;
};
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show():void{
var ref:V_BirdItem;
var num:int;
sleep = 4;
progress_mc.visible = false;
y = (dsty = -100);
moneys_mc.points_txt.text = "0";
diamonds_mc.points_txt.text = "0";
var i:uint = 1;
while (i < 7) {
(getChildByName(("b" + i.toString())) as MovieClip).visible = false;
i++;
};
var dst:Number = (63 * (6 / V_User.birds_id.length));
i = 0;
while (i < V_User.birds_id.length) {
ref = (getChildByName(("b" + (i + 1).toString())) as V_BirdItem);
num = V_User.birds_id[i];
ref.bird_mc.gotoAndStop(num);
ref.points_txt.text = "0";
ref.visible = true;
ref.x = (-8 + (dst * i));
i++;
};
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
V_SoundLib.playSound(25);
dispatchEvent(new Event(EVENT_PAUSE));
}
public function update(dt:Number):void{
if (sleep > 0){
sleep = (sleep - dt);
return;
};
if (dsty < 0){
dsty = (dsty + (300 * dt));
if (dsty > 0){
dsty = 0;
};
y = dsty;
};
moneys_mc.points_txt.text = V_User.points.toString();
}
public function applyProgress():void{
var ref:V_BirdItem;
var num:int;
var numF:int = Math.round((V_User.progress_level * progress_mc.totalFrames));
if (numF > 1){
progress_mc.visible = true;
};
var oldNum:int = progress_mc.currentFrame;
progress_mc.gotoAndStop(numF);
if (((!((oldNum == progress_mc.totalFrames))) && ((progress_mc.currentFrame >= progress_mc.totalFrames)))){
V_SoundLib.playSound(29);
};
moneys_mc.points_txt.text = V_User.points.toString();
diamonds_mc.points_txt.text = V_User.birds_level[8];
var i:uint;
while (i < V_User.birds_id.length) {
ref = (getChildByName(("b" + (i + 1).toString())) as V_BirdItem);
num = V_User.birds_id[i];
num--;
ref.points_txt.text = V_User.birds_level[num];
i++;
};
}
}
}//package
Section 99
//V_IWindow (V_IWindow)
package {
public interface V_IWindow {
function update(:Number):void;
function hide():void;
function show():void;
}
}//package
Section 100
//V_Katapulta (V_Katapulta)
package {
import flash.display.*;
public class V_Katapulta extends Sprite {
private var sleep_fire:Number;// = 0
private var sleepAnim:Number;// = 0
private var mc:MovieClip;
private var triple:V_Triple;
private var tripleHeight:Number;// = 0
private var curr_bird:V_Bird;
private var next_id:int;
private var flag_fire:Boolean;// = false
private var flag_draw_triple:Boolean;// = false
private var fire_time:Number;// = 0
public function V_Katapulta(){
super();
triple = new V_Triple();
addChild(triple);
triple.visible = false;
mc = new V_KatapultaRes();
addChild(mc);
mc.scaleX = (mc.scaleY = 0.9);
mc.y = -3;
mc.x = -1;
mc.prev_mc.gotoAndStop(1);
mc.res1_mc.gotoAndStop(1);
mc.res2_mc.gotoAndStop(1);
}
public function getNextBird():int{
return (next_id);
}
public function update(dt:Number):void{
if (sleep_fire >= 0){
sleep_fire = (sleep_fire - dt);
};
if (triple.visible){
triple.update(dt);
};
if (mc.res1_mc.currentFrame > 1){
sleepAnim = (sleepAnim - dt);
if (sleepAnim < 0){
sleepAnim = 0.01;
if (curr_bird){
curr_bird.visible = false;
};
if (mc.res1_mc.currentFrame >= mc.res1_mc.totalFrames){
mc.res1_mc.gotoAndStop(1);
if (curr_bird){
curr_bird.visible = true;
};
} else {
mc.res1_mc.nextFrame();
};
};
};
if (flag_fire){
fire_time = (fire_time + dt);
if (fire_time >= 0.025){
fire_time = 0;
};
flag_fire = false;
};
}
public function switchBird():void{
var num:int;
if (curr_bird){
num = getIdBird();
if (curr_bird.getCurrentFrame() != 65){
updateIdBird(next_id);
createNextBird(num);
};
};
}
public function createBird(num:int):void{
if (!curr_bird){
curr_bird = V_Factory.createBird();
addChild(curr_bird);
};
curr_bird.Update(num);
curr_bird.setAnimation(V_Utility.SIT_KATAPULTA_ANIM, 1, 1);
curr_bird.Pos = 0;
curr_bird.x = 0;
curr_bird.y = 0;
curr_bird.dx = 0;
curr_bird.dy = 1;
curr_bird.inserted = false;
applYColorForTriple();
}
public function applYColorForTriple():void{
var col:uint = 0xFFFFFF;
switch (curr_bird.getId()){
case 1:
col = 0xFFFF00;
break;
case 2:
col = 0xFF0000;
break;
case 3:
col = 0xFF00;
break;
case 4:
col = 0xFF;
break;
case 5:
col = 0xFFFF;
break;
case 6:
col = 0x996600;
break;
case 7:
break;
case 8:
col = 0;
break;
};
triple.Color = col;
}
public function updateIdBird(new_num:int):void{
if (curr_bird){
if (curr_bird.getCurrentFrame() != 65){
curr_bird.Update(new_num);
curr_bird.setAnimation(V_Utility.SIT_KATAPULTA_ANIM, 1, 1);
};
createNextBird(new_num);
applYColorForTriple();
};
}
public function isTriple():Boolean{
return (triple.visible);
}
public function getIdBird():int{
var num = -1;
if (curr_bird != null){
num = curr_bird.getId();
};
return (num);
}
public function setTripleHeight(val:Number):void{
triple.setHeight(val);
}
public function createNextBird(num:int):void{
next_id = num;
mc.prev_mc.gotoAndStop(next_id);
}
public function applyCoreBonus():void{
curr_bird.setAnimation(25, 1, 1);
}
public function setFlagTriple(val:Boolean):void{
triple.visible = val;
triple.apply();
}
public function fire():V_Bird{
var ref:V_Bird;
if (sleep_fire <= 0){
flag_fire = true;
ref = curr_bird;
sleep_fire = 0.5;
curr_bird = null;
if (!ref){
return (null);
};
mc.res1_mc.gotoAndStop(2);
if (ref.getCurrentFrame() != 65){
if (isTriple()){
ref.dx = 1000;
} else {
ref.dx = 600;
};
} else {
ref.dx = 700;
};
};
return (ref);
}
}
}//package
import flash.display.*;
class V_Triple extends Sprite {
private var color:uint;// = 0xFFFFFF
private var sleep:Number;// = 0
private var dir:int;// = 1
private function V_Triple(){
super();
redrawTriple();
}
public function apply():void{
sleep = 30;
this.alpha = 1;
}
public function setHeight(val:Number):void{
scaleY = ((540 - val) / 540);
}
private function redrawTriple():void{
this.graphics.clear();
this.graphics.lineStyle(2, color);
this.graphics.beginFill(color, 0.5);
this.graphics.moveTo(-25, 0);
this.graphics.lineTo(25, 0);
this.graphics.lineTo(0, -540);
this.graphics.lineTo(-25, 0);
this.graphics.endFill();
}
public function set Color(val:uint):void{
color = val;
redrawTriple();
}
public function update(dt:Number):void{
if (sleep > 0){
sleep = (sleep - dt);
};
if (sleep <= 4){
if ((((alpha >= 1)) && ((dir > 0)))){
dir = -1;
} else {
if ((((((alpha < 0.5)) && ((sleep > 0)))) && ((dir < 0)))){
dir = 1;
} else {
if (alpha <= 0){
this.visible = false;
};
};
};
alpha = (alpha + (dt * dir));
};
}
}
Section 101
//V_KatapultaRes (V_KatapultaRes)
package {
import flash.display.*;
public dynamic class V_KatapultaRes extends MovieClip {
public var res2_mc:MovieClip;
public var res1_mc:MovieClip;
public var prev_mc:MovieClip;
}
}//package
Section 102
//V_Levels (V_Levels)
package {
import flash.utils.*;
public class V_Levels {
private static var Level1:Class = V_Levels_Level1;
private static var Level2:Class = V_Levels_Level2;
private static var Level3:Class = V_Levels_Level3;
private static var Level4:Class = V_Levels_Level4;
private static var Level5:Class = V_Levels_Level5;
private static var Level6:Class = V_Levels_Level6;
private static var Level7:Class = V_Levels_Level7;
private static var Level8:Class = V_Levels_Level8;
public function V_Levels(){
super();
}
public static function getLevel(num:int):ByteArray{
switch (num){
case 1:
return ((new Level1() as ByteArray));
case 2:
return ((new Level2() as ByteArray));
case 3:
return ((new Level3() as ByteArray));
case 4:
return ((new Level4() as ByteArray));
case 5:
return ((new Level5() as ByteArray));
case 6:
return ((new Level6() as ByteArray));
case 7:
return ((new Level7() as ByteArray));
case 8:
return ((new Level8() as ByteArray));
};
return ((new Level1() as ByteArray));
}
}
}//package
Section 103
//V_Levels_Level1 (V_Levels_Level1)
package {
import mx.core.*;
public class V_Levels_Level1 extends ByteArrayAsset {
}
}//package
Section 104
//V_Levels_Level2 (V_Levels_Level2)
package {
import mx.core.*;
public class V_Levels_Level2 extends ByteArrayAsset {
}
}//package
Section 105
//V_Levels_Level3 (V_Levels_Level3)
package {
import mx.core.*;
public class V_Levels_Level3 extends ByteArrayAsset {
}
}//package
Section 106
//V_Levels_Level4 (V_Levels_Level4)
package {
import mx.core.*;
public class V_Levels_Level4 extends ByteArrayAsset {
}
}//package
Section 107
//V_Levels_Level5 (V_Levels_Level5)
package {
import mx.core.*;
public class V_Levels_Level5 extends ByteArrayAsset {
}
}//package
Section 108
//V_Levels_Level6 (V_Levels_Level6)
package {
import mx.core.*;
public class V_Levels_Level6 extends ByteArrayAsset {
}
}//package
Section 109
//V_Levels_Level7 (V_Levels_Level7)
package {
import mx.core.*;
public class V_Levels_Level7 extends ByteArrayAsset {
}
}//package
Section 110
//V_Levels_Level8 (V_Levels_Level8)
package {
import mx.core.*;
public class V_Levels_Level8 extends ByteArrayAsset {
}
}//package
Section 111
//V_LoaderRes (V_LoaderRes)
package {
import flash.display.*;
public dynamic class V_LoaderRes extends MovieClip {
}
}//package
Section 112
//V_LoaderWnd (V_LoaderWnd)
package {
public class V_LoaderWnd extends V_LoaderRes implements V_IWindow {
private var bird:V_Bird;
private var dir:int;// = -1
public function V_LoaderWnd(){
super();
bird = new V_Bird();
bird.setAnimation(V_Utility.MOVE_ANIM, 1, 1);
bird.scaleX = (bird.scaleY = 1.125);
addChild(bird);
bird.Update(7);
bird.x = 400;
bird.y = 448;
}
public function update(dt:Number):void{
moving(dt);
bird.playAnimation();
if (this.currentFrame >= this.totalFrames){
this.gotoAndStop(1);
} else {
this.nextFrame();
};
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show():void{
}
private function moving(dt:Number):void{
bird.x = (bird.x + ((dt * 100) * dir));
if ((((bird.x < 284)) && ((dir < 0)))){
bird.x = 284;
dir = 1;
bird.scaleX = -1.125;
} else {
if ((((bird.x > 525)) && ((dir > 0)))){
bird.x = 525;
dir = -1;
bird.scaleX = 1.125;
};
};
}
}
}//package
Section 113
//V_MenuRes (V_MenuRes)
package {
import flash.display.*;
public dynamic class V_MenuRes extends MovieClip {
public var bird_mc:MovieClip;
public var download_btn:SimpleButton;
public var play_btn:SimpleButton;
}
}//package
Section 114
//V_MenuWnd (V_MenuWnd)
package {
import flash.events.*;
public class V_MenuWnd extends V_MenuRes implements V_IWindow {
public static const EVENT_START_PLAY_GAME:String = "START_PLAY_GAME";
public function V_MenuWnd(){
super();
this.play_btn.addEventListener(MouseEvent.MOUSE_UP, onMouse);
this.download_btn.addEventListener(MouseEvent.MOUSE_UP, onMouse);
this.play_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
this.download_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
this.play_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
this.download_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
}
public function update(dt:Number):void{
}
public function show():void{
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
if (evt.type == MouseEvent.MOUSE_DOWN){
V_SoundLib.playSound(25);
return;
};
switch (evt.currentTarget.name){
case play_btn.name:
dispatchEvent(new Event(EVENT_START_PLAY_GAME));
break;
case download_btn.name:
V_DownLoadManager.download();
break;
};
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
}
}//package
Section 115
//V_OptionsRes (V_OptionsRes)
package {
import flash.display.*;
public dynamic class V_OptionsRes extends MovieClip {
public var ok_btn:SimpleButton;
public var s2_mc:MovieClip;
public var s1_mc:MovieClip;
public var slider1_mc:MovieClip;
public var slider2_mc:MovieClip;
}
}//package
Section 116
//V_OptionsWnd (V_OptionsWnd)
package {
import flash.events.*;
import flash.display.*;
public class V_OptionsWnd extends V_OptionsRes implements V_IWindow {
private var ref_s1:MovieClip;
private var ref_s2:MovieClip;
private var flag:Boolean;// = false
public function V_OptionsWnd(){
super();
this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
this.s1_mc.gotoAndStop(Math.round((this.s1_mc.totalFrames * 0.6)));
this.s2_mc.gotoAndStop(Math.round((this.s2_mc.totalFrames * 1)));
this.slider1_mc.alpha = 0;
this.slider2_mc.alpha = 0;
V_SoundLib.setMusicVolume(0.6);
V_SoundLib.setSoundVolume(1);
this.ok_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
this.ok_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
this.slider1_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
this.slider2_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
}
private function onAdded(evt:Event):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onMouse);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
}
public function hide():void{
flag = false;
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
switch (evt.type){
case MouseEvent.MOUSE_DOWN:
switch (evt.currentTarget.name){
case ok_btn.name:
V_SoundLib.playSound(25);
hide();
break;
case slider1_mc.name:
ref_s1 = slider1_mc;
ref_s2 = s1_mc;
break;
case slider2_mc.name:
ref_s1 = slider2_mc;
ref_s2 = s2_mc;
break;
};
checkSound();
break;
case MouseEvent.MOUSE_MOVE:
checkSound();
break;
case MouseEvent.MOUSE_UP:
checkSound();
ref_s1 = null;
ref_s2 = null;
break;
};
}
private function checkSound():void{
var prc:Number;
if (((ref_s1) && (ref_s2))){
prc = (ref_s1.mouseX / ref_s1.width);
if (prc < 0){
prc = 0;
};
if (prc > 1){
prc = 1;
};
if (prc <= 0){
ref_s2.visible = false;
} else {
ref_s2.visible = true;
};
ref_s2.gotoAndStop(Math.round((prc * ref_s2.totalFrames)));
if (ref_s1 === slider1_mc){
V_SoundLib.setMusicVolume(prc);
} else {
V_SoundLib.setSoundVolume(prc);
};
};
}
public function update(dt:Number):void{
if (flag){
if (this.alpha < 1){
this.alpha = (this.alpha + (dt * 5));
};
} else {
if (this.alpha > 0){
this.alpha = (this.alpha - (dt * 5));
} else {
if (this.parent){
this.parent.removeChild(this);
};
};
};
}
public function show():void{
this.alpha = 0;
flag = true;
}
}
}//package
Section 117
//V_Particle1Res (V_Particle1Res)
package {
import flash.display.*;
public dynamic class V_Particle1Res extends MovieClip {
public var p1_mc:MovieClip;
}
}//package
Section 118
//V_Path (V_Path)
package {
public class V_Path {
private var length:uint;// = 0
private var mas_points:Array;
public function V_Path(){
super();
mas_points = new Array();
}
public function addPoints(p:V_SplinePoint):void{
mas_points[length] = p;
length = (length + 1);
}
public function clear():void{
mas_points.length = 0;
length = 0;
}
public function getPoints(num:int):V_SplinePoint{
if (num < 0){
num = 0;
};
if (num >= length){
num = (length - 1);
};
return (mas_points[num]);
}
public function getLength():int{
return (length);
}
}
}//package
Section 119
//V_PauseRes (V_PauseRes)
package {
import flash.display.*;
public dynamic class V_PauseRes extends MovieClip {
public var resume_btn:SimpleButton;
public var download_btn:SimpleButton;
public var options_btn:SimpleButton;
public var retart_btn:SimpleButton;
}
}//package
Section 120
//V_PauseWnd (V_PauseWnd)
package {
import flash.events.*;
public class V_PauseWnd extends V_PauseRes implements V_IWindow {
private var flag:Boolean;// = false
public static const EVENT_SHOW_OPTIONS:String = "EVENT_SHOW_OPTIONS";
public static const EVENT_RESTART_LEVEL:String = "EVENT_RESTART_LEVEL";
public function V_PauseWnd(){
super();
resume_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
retart_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
options_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
download_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
resume_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
retart_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
options_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
download_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
}
public function update(dt:Number):void{
if (flag){
if (this.alpha < 1){
this.alpha = (this.alpha + (dt * 5));
};
} else {
if (this.alpha > 0){
this.alpha = (this.alpha - (dt * 5));
} else {
if (this.parent){
this.parent.removeChild(this);
};
};
};
}
public function hide():void{
flag = false;
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
V_SoundLib.playSound(25);
switch (evt.currentTarget.name){
case resume_btn.name:
dispatchEvent(new Event(V_IntrefaceWnd.EVENT_PAUSE));
break;
case retart_btn.name:
dispatchEvent(new Event(EVENT_RESTART_LEVEL));
break;
case options_btn.name:
dispatchEvent(new Event(EVENT_SHOW_OPTIONS));
break;
case download_btn.name:
V_DownLoadManager.download();
break;
};
}
public function show():void{
this.alpha = 0;
flag = true;
}
}
}//package
Section 121
//V_PointsText (V_PointsText)
package {
import flash.display.*;
public class V_PointsText extends V_CifraText {
public function V_PointsText(){
super();
}
public function update(dt:Number):void{
this.scaleX = (this.scaleX + dt);
if (this.scaleX > 0.4){
this.alpha = ((1 - this.scaleX) / 0.5);
};
this.scaleY = this.scaleX;
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show(val:int):void{
var s:String;
var m:MovieClip;
var p:int;
b1.visible = false;
b2.visible = false;
b3.visible = false;
var str:String = val.toString();
var i:int;
while (i < str.length) {
s = str.charAt(i);
m = (getChildByName(("b" + (i + 1).toString())) as MovieClip);
p = int(s);
if (m){
m.visible = true;
m.gotoAndStop(((p)>0) ? p : 10);
};
i++;
};
this.scaleX = (this.scaleY = 0);
this.alpha = 1;
this.visible = true;
}
}
}//package
Section 122
//V_ScoresRes (V_ScoresRes)
package {
import flash.display.*;
public dynamic class V_ScoresRes extends MovieClip {
public var money_mc:V_BirdItem;
public var b1:V_BirdItem;
public var diamond_mc:V_BirdItem;
public var b2:V_BirdItem;
public var combo_mc:V_BirdItem;
public var b3:V_BirdItem;
public var b4:V_BirdItem;
public var time_mc:V_BirdItem;
public var b5:V_BirdItem;
public var b6:V_BirdItem;
public var continue_btn:SimpleButton;
}
}//package
Section 123
//V_SoundLib (V_SoundLib)
package {
import flash.media.*;
public class V_SoundLib {
private static var mus_channels:Array;
private static var snd_channels:Array;
private static var musics:Array;
private static var mus_transf:SoundTransform;
private static var sounds:Array;
private static var snd_transf:SoundTransform;
public function V_SoundLib(){
super();
}
public static function stopMusic(num:int):void{
var ch:SoundChannel = (mus_channels[num] as SoundChannel);
mus_channels[num] = null;
if (ch){
ch.stop();
};
ch = null;
}
public static function setSoundVolume(val:Number):void{
snd_transf.volume = val;
}
public static function stopSound(num:int):void{
var ch:SoundChannel = (snd_channels[num] as SoundChannel);
snd_channels[num] = null;
if (ch){
ch.stop();
};
ch = null;
}
public static function init():void{
sounds = new Array();
musics = new Array();
snd_channels = new Array();
mus_channels = new Array();
snd_transf = new SoundTransform();
mus_transf = new SoundTransform();
addSound(0, new Bird_in_ROW());
addSound(1, new Bird_Photo());
addSound(2, new Birds_CHANGE());
addSound(3, new Birds_Connect());
addSound(4, new Birds_Revers_walk());
addSound(5, new Birds_WALK());
addSound(6, new Birds_WALK_in_cage());
addSound(7, new Bonus_Almaz_Appears());
addSound(8, new Bonus_BOMB());
addSound(9, new BONUS_pause());
addSound(10, new Bonus_pricel());
addSound(11, new BONUS_revers());
addSound(12, new BUM01());
addSound(13, new BUM02());
addSound(14, new BUM03());
addSound(15, new coin());
addSound(16, new Combo01());
addSound(17, new Combo02());
addSound(18, new Combo03());
addSound(19, new Egg_destroy());
addSound(20, new Egg_destroy_coins());
addSound(21, new Launch());
addSound(22, new Level_LOSE());
addSound(23, new Level_WIN());
addSound(24, new Match());
addSound(25, new mouse_click());
addSound(26, new mouse_over());
addSound(27, new Particles());
addSound(28, new Photo());
addSound(29, new Progress_Bar());
addMusic(0, new Gameplay());
}
private static function addMusic(num:int, snd:Sound):void{
musics[num] = snd;
}
private static function addSound(num:int, snd:Sound):void{
sounds[num] = snd;
}
public static function playMusic(num:int, loop:Boolean=false):void{
stopMusic(num);
var ch:SoundChannel = (mus_channels[num] as SoundChannel);
ch = musics[num].play(0, int.MAX_VALUE);
mus_channels[num] = ch;
ch.soundTransform = mus_transf;
}
public static function playSound(num:int, loop:Boolean=false):void{
var ch:SoundChannel = (snd_channels[num] as SoundChannel);
stopSound(num);
ch = sounds[num].play(0, 1);
snd_channels[num] = ch;
ch.soundTransform = snd_transf;
}
public static function setMusicVolume(val:Number):void{
mus_transf.volume = val;
var ch:SoundChannel = (mus_channels[0] as SoundChannel);
if (ch){
ch.soundTransform = mus_transf;
};
}
}
}//package
Section 124
//V_SplashWnd (V_SplashWnd)
package {
import flash.display.*;
public class V_SplashWnd extends Sprite implements V_IWindow {
public function V_SplashWnd(){
super();
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(-10, -10, 820, 620);
this.graphics.endFill();
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show():void{
this.alpha = 1;
V_SoundLib.playSound(28);
}
public function update(dt:Number):void{
if (this.alpha > 0){
this.alpha = (this.alpha - (dt * 1.5));
} else {
hide();
};
}
}
}//package
Section 125
//V_Spline (V_Spline)
package {
public class V_Spline {
private var mas_points:Array;
private var first_pos:int;
private var point:V_SplinePoint;
private var count_points:int;
private var _anch2:V_SplinePoint;
private var _anch1:V_SplinePoint;
private var last_pos:int;
private var f_scale:Number;
private var _last:V_SplinePoint;
private var _first:V_SplinePoint;
public function V_Spline(){
super();
}
public function initSpline(first:V_SplinePoint, last:V_SplinePoint, anch1:V_SplinePoint, anch2:V_SplinePoint):void{
count_points = 0;
_first = first;
_last = last;
_anch1 = anch1;
_anch2 = anch2;
}
public function getA2tControlPoint():V_SplinePoint{
return (_anch2);
}
public function getFirstControlPoint():V_SplinePoint{
return (_first);
}
public function getPoint(pos:Number):V_SplinePoint{
var point:V_SplinePoint = new V_SplinePoint();
point.x = (((((((1 - pos) * (1 - pos)) * (1 - pos)) * _first.x) + ((((3 * pos) * (1 - pos)) * (1 - pos)) * _anch1.x)) + ((((3 * pos) * pos) * (1 - pos)) * _anch2.x)) + (((pos * pos) * pos) * _last.x));
point.y = (((((((1 - pos) * (1 - pos)) * (1 - pos)) * _first.y) + ((((3 * pos) * (1 - pos)) * (1 - pos)) * _anch1.y)) + ((((3 * pos) * pos) * (1 - pos)) * _anch2.y)) + (((pos * pos) * pos) * _last.y));
return (point);
}
public function getCountPoints():int{
return (count_points);
}
public function getLastControlPoint():V_SplinePoint{
return (_last);
}
public function calculatePoints(last_point:V_SplinePoint, ref:V_Path=null):void{
var curr:V_SplinePoint;
var dist:Number;
if (((!(mas_points)) && ((ref == null)))){
mas_points = new Array();
};
var last:V_SplinePoint = last_point;
var p:V_SplinePoint = new V_SplinePoint();
var t:Number = 0;
while (t <= 1) {
curr = getPoint(t);
dist = V_Utility.distance(last.x, last.y, curr.x, curr.y);
if (dist >= 1){
if (ref == null){
mas_points[count_points] = curr;
count_points = (count_points + 1);
last = curr;
} else {
ref.addPoints(curr);
last = curr;
};
};
t = (t + 1E-5);
};
}
public function getPointsIsArray(num:int):V_SplinePoint{
if (num >= count_points){
num = (count_points - 1);
};
if (num < 0){
num = 0;
};
return (mas_points[num]);
}
public function getA1ControlPoint():V_SplinePoint{
return (_anch1);
}
}
}//package
Section 126
//V_SplinePoint (V_SplinePoint)
package {
public class V_SplinePoint {
public var x:Number;
public var y:Number;
public function V_SplinePoint(){
super();
}
}
}//package
Section 127
//V_StartGameWnd (V_StartGameWnd)
package {
import flash.display.*;
public class V_StartGameWnd extends Sprite implements V_IWindow {
private var area:V_Area;
private var sleep:Number;// = 0
public function V_StartGameWnd(){
super();
area = new V_Area();
addChild(area);
this.graphics.beginFill(0, 0.05);
this.graphics.drawRect(0, 0, 800, 600);
this.graphics.endFill();
}
public function update(dt:Number):void{
if (sleep > 0){
sleep = (sleep - dt);
};
if ((((sleep > 0)) && ((area.scaleX < 1)))){
area.scaleX = (area.scaleX + (dt * 2));
if (area.scaleX > 1){
area.scaleX = 1;
};
area.scaleY = area.scaleX;
} else {
if ((((sleep <= 0)) && ((area.scaleX > 0)))){
area.scaleX = (area.scaleX + (dt * 2));
area.alpha = (2 - area.scaleX);
if (area.scaleX >= 2){
area.scaleX = 0;
hide();
};
area.scaleY = area.scaleX;
};
};
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show():void{
sleep = 3;
area.alpha = 1;
area.b2.visible = false;
area.b1.gotoAndStop(V_User.curr_level);
area.x = 400;
area.y = 300;
area.scaleX = (area.scaleY = 0);
}
}
}//package
Section 128
//V_StartParticle (V_StartParticle)
package {
import flash.display.*;
public class V_StartParticle extends Sprite {
public var oldP:Number;// = 0
public var Pos:Number;// = 0
public var cx:Number;// = 0
public var cy:Number;// = 0
public var sleep:Number;// = 0
public var creation:Boolean;// = true
public function V_StartParticle(){
super();
}
public function reset():void{
Pos = 0;
oldP = 0;
sleep = 0;
creation = true;
cx = -100;
cy = -100;
while (numChildren) {
removeChildAt(0);
};
if (this.parent){
this.parent.removeChild(this);
};
}
public function update(dt:Number):void{
var it:V_ParticleItem;
var p:V_ParticleItem;
if (!this.parent){
return;
};
sleep = (sleep - dt);
if ((((sleep <= 0)) && (creation))){
it = new V_ParticleItem();
addChild(it);
it.x = cx;
it.y = cy;
};
var i:int;
while (i < numChildren) {
p = (getChildAt(i) as V_ParticleItem);
p.update(dt);
i = (i + 1);
};
if ((((numChildren <= 0)) && (this.parent))){
this.parent.removeChild(this);
};
}
}
}//package
class V_ParticleItem extends V_Particle1Res {
private var sleep:Number;// = 0
private function V_ParticleItem(){
super();
this.scaleX = (this.scaleY = 1.5);
this.rotation = (Math.random() * 360);
}
public function update(dt:Number):void{
this.scaleX = (this.scaleX - (dt * 2));
this.rotation = (this.rotation + (100 * dt));
this.scaleY = this.scaleX;
if ((((this.scaleX <= 0)) && (this.parent))){
this.parent.removeChild(this);
refersh();
};
}
public function refersh():void{
p1_mc.gotoAndStop(1);
}
}
Section 129
//V_Statistics (V_Statistics)
package {
import flash.events.*;
import flash.display.*;
public class V_Statistics extends V_ScoresRes implements V_IWindow {
private var foto:V_Foto;
private var flag:Boolean;// = false
private var first_click:Boolean;
public function V_Statistics(){
super();
combo_mc.bird_mc.gotoAndStop(11);
diamond_mc.bird_mc.gotoAndStop(9);
money_mc.bird_mc.gotoAndStop(10);
time_mc.bird_mc.gotoAndStop(12);
continue_btn.addEventListener(MouseEvent.MOUSE_DOWN, onMouse);
continue_btn.addEventListener(MouseEvent.MOUSE_OVER, onMouse);
foto = new V_Foto();
foto.x = 60;
foto.y = 100;
var i:uint = 1;
while (i < 7) {
(getChildByName(("b" + i.toString())) as MovieClip).bird_mc.gotoAndStop(11);
i++;
};
}
public function hide():void{
flag = false;
}
public function getTime():String{
var str:String = "";
var min:int = (V_User.time_level / 60);
var sec:int = (V_User.time_level - (min * 60));
str = ((timeFormat(min) + ":") + timeFormat(sec));
return (str);
}
private function onMouse(evt:MouseEvent):void{
if (evt.type == MouseEvent.MOUSE_OVER){
V_SoundLib.playSound(26);
return;
};
if (((((first_click) && (V_Utility.isRenderToTargetForCurrGame))) && (!(foto.getIsEvent())))){
foto.mouseDown();
first_click = false;
} else {
V_SoundLib.playSound(25);
dispatchEvent(new Event(V_MenuWnd.EVENT_START_PLAY_GAME));
};
}
public function timeFormat(val:int):String{
var str:String = val.toString();
if (str.length == 1){
str = ("0" + str);
};
return (str);
}
public function update(dt:Number):void{
foto.update(dt);
if (flag){
if (this.alpha < 1){
this.alpha = (this.alpha + (dt * 5));
};
} else {
if (this.alpha > 0){
this.alpha = (this.alpha - (dt * 5));
} else {
if (this.parent){
this.parent.removeChild(this);
};
};
};
}
public function show():void{
var n:int;
var count:int;
var ref_mc:V_BirdItem;
flag = true;
first_click = true;
this.alpha = 0;
foto.reset();
foto.show(2);
V_SoundLib.stopMusic(0);
V_SoundLib.playSound(23);
if (V_Utility.isRenderToTargetForCurrGame){
addChild(foto);
};
var i:uint = 1;
while (i < 7) {
getChildByName(("b" + i.toString())).visible = false;
i++;
};
i = 0;
while (i < V_User.birds_id.length) {
(getChildByName(("b" + (i + 1).toString())) as MovieClip).bird_mc.gotoAndStop(V_User.birds_id[i]);
n = V_User.birds_id[i];
n--;
count = V_User.birds_level[n];
ref_mc = (getChildByName(("b" + (i + 1).toString())) as V_BirdItem);
ref_mc.points_txt.text = count.toString();
ref_mc.visible = true;
i++;
};
combo_mc.points_txt.text = V_User.combo_level.toString();
diamond_mc.points_txt.text = V_User.birds_level[8];
money_mc.points_txt.text = V_User.points.toString();
time_mc.points_txt.text = getTime();
}
}
}//package
Section 130
//V_TextCombo (V_TextCombo)
package {
public class V_TextCombo extends V_ComboText {
public function V_TextCombo(){
super();
}
public function update(dt:Number):void{
this.scaleX = (this.scaleX + dt);
if (this.scaleX > 0.5){
this.alpha = ((1 - this.scaleX) / 0.5);
};
this.scaleY = this.scaleX;
}
public function hide():void{
if (this.parent){
this.parent.removeChild(this);
};
}
public function show(val:int):void{
b1.visible = false;
b1.gotoAndStop(val);
b1.visible = true;
this.scaleX = (this.scaleY = 0);
this.alpha = 1;
this.visible = true;
}
}
}//package
Section 131
//V_TileObject (V_TileObject)
package {
import flash.display.*;
import flash.geom.*;
public class V_TileObject extends Sprite {
private var bmp:Bitmap;
public function V_TileObject(id:int, num:int, xx:Number, yy:Number, ang:Number){
var cx:int;
var cy:int;
var resData:BitmapData;
var rect:Rectangle;
super();
bmp = new Bitmap();
addChild(bmp);
var bmData:BitmapData = V_Utility.tilesManager.getTile(id);
if (bmData){
cx = (num / 10);
cy = (num - (cx * 10));
resData = new BitmapData(100, 100, true);
rect = new Rectangle((cy * 100), (cx * 100), 100, 100);
resData.copyPixels(bmData, rect, new Point(0, 0));
bmp.bitmapData = resData;
};
x = xx;
y = yy;
}
}
}//package
Section 132
//V_TilesManager (V_TilesManager)
package {
import flash.display.*;
public class V_TilesManager extends MovieClip {
private var bitmaps:Array;
public function V_TilesManager(){
this.bitmaps = new Array();
this.init();
}
private function init():void{
trace("init");
this.bitmaps[10] = new TILE10();
this.bitmaps[11] = new TILE11();
this.bitmaps[12] = new TILE12();
this.bitmaps[13] = new TILE13();
this.bitmaps[14] = new TILE14();
this.bitmaps[20] = new TILE20();
this.bitmaps[21] = new TILE21();
this.bitmaps[23] = new TILE23();
}
public function getTile(_arg1:uint):BitmapData{
return (this.bitmaps[_arg1]);
}
}
}//package
Section 133
//V_Tutorial (V_Tutorial)
package {
import flash.display.*;
public dynamic class V_Tutorial extends MovieClip {
}
}//package
Section 134
//V_Tutorial1 (V_Tutorial1)
package {
import flash.display.*;
public class V_Tutorial1 extends Sprite {
private var learn:Boolean;// = false
private var objs:Array;
public function V_Tutorial1(){
super();
}
public function isLockMoving():Boolean{
return (((objs.length)>0) ? !((objs[0].status == 110)) : false);
}
public function getNewXForKtapulta():Number{
return (((objs.length)>1) ? objs[0].x : -1);
}
public function isLearned():Boolean{
return (learn);
}
public function setRefObjects(ref_objs:Array):void{
objs = ref_objs;
}
public function isLockFire():Boolean{
return (((objs.length)>0) ? !((objs[0].status == 104)) : true);
}
public function learning():void{
learn = true;
}
}
}//package
Section 135
//V_Tutorial2 (V_Tutorial2)
package {
import flash.display.*;
public class V_Tutorial2 extends Sprite {
private var learn:Boolean;// = false
private var egges:Boolean;// = false
private var objs:Array;
public function V_Tutorial2(){
super();
}
public function setRefObjects(ref_objs:Array):void{
objs = ref_objs;
}
public function check():Boolean{
return (egges);
}
public function isLockMoving():Boolean{
if (!egges){
return (false);
};
return (((objs.length)>0) ? !((objs[0].status == 110)) : false);
}
public function isLockFire():Boolean{
if (!egges){
return (false);
};
return (((objs.length)>0) ? !((objs[0].status == 104)) : true);
}
public function setEgges(val:Boolean):void{
egges = val;
}
public function getNewXForKtapulta():Number{
return (((objs.length)>1) ? objs[1].x : -1);
}
public function isLearned():Boolean{
return (learn);
}
public function learning():void{
learn = true;
}
}
}//package
Section 136
//V_Tutorial4 (V_Tutorial4)
package {
public class V_Tutorial4 {
private var learn:Boolean;// = false
private var lock:Boolean;// = false
public function V_Tutorial4(){
super();
}
public function applyLock():void{
lock = true;
}
public function isLockFire():Boolean{
return (lock);
}
public function isLearned():Boolean{
return (learn);
}
public function isLockMoving():Boolean{
return (lock);
}
public function learning():void{
learn = true;
lock = false;
}
}
}//package
Section 137
//V_Tutotrial3 (V_Tutotrial3)
package {
import flash.display.*;
public class V_Tutotrial3 extends Sprite {
private var learn:Boolean;
private var ref_diamonds:Array;
private var objs:Array;
public function V_Tutotrial3(){
super();
}
public function isLockMoving():Boolean{
return ((ref_diamonds.length) ? true : false);
}
public function setRefObjects(diamonds:Array, ref_objs:Array):void{
ref_diamonds = diamonds;
objs = ref_objs;
}
public function isLockFire():Boolean{
return ((ref_diamonds.length) ? true : false);
}
public function getNewXForKtapulta():Number{
var i:int;
if (ref_diamonds.length > 0){
i = 0;
while (i < ref_diamonds.length) {
if (ref_diamonds[i].vx > 100){
ref_diamonds[i].vx = 70;
};
ref_diamonds[0].vy = 0;
if (ref_diamonds[i].x < 0){
ref_diamonds[i].x = 0;
};
if (ref_diamonds[i].x > 800){
ref_diamonds[i].x = 800;
};
i++;
};
i = 0;
while (i < objs.length) {
if (objs[i].status != 104){
objs[i].status = 104;
objs[i].dy = 0;
objs[i].vx = 0;
};
i++;
};
};
return (((ref_diamonds.length)>0) ? ref_diamonds[0].x : -1);
}
public function isLearned():Boolean{
return (learn);
}
public function learning():void{
learn = true;
}
}
}//package
Section 138
//V_User (V_User)
package {
public class V_User {
public static var birds_id:Array = new Array();
public static var points:uint = 0;
public static var progress_level:Number = 0;
public static var combo_level:int = 0;
public static var curr_level:int = 1;
public static var time_level:Number = 0;
public static var birds_level:Array = new Array();
public function V_User(){
super();
}
public static function refreshLevelProgress():void{
birds_id.length = 0;
combo_level = 0;
progress_level = 0;
points = 0;
time_level = 0;
var i:uint;
while (i < 12) {
birds_level[i] = 0;
i++;
};
}
}
}//package
Section 139
//V_Utility (V_Utility)
package {
import flash.utils.*;
import flash.display.*;
public class V_Utility {
public static const SIT_KATAPULTA_ANIM:int = 7;
public static const DIGIT_ANIM:int = 16;
public static const MORG_ANIM:int = 6;
public static const HOOK_CLOSEPLAY_ANIM:int = 14;
public static const EGGE_BIRD_CEP_MOVE:int = 38;
public static const EGGE_BIRD_MONEY_MOVE:int = 41;
public static const EGGE_BIRD_MOVE:int = 27;
public static const STOP_ANIM:int = 2;
public static const BLOW2_ANIM:int = 19;
public static const EGGE_BIRD_ID:int = 10001;
public static const EGGE_BIRD_DELETE:int = 28;
public static const EGGE_BIRD_CEP_STOP:int = 37;
public static const EGG_ANIM:int = 22;
public static const EGGE_BIRD_MONEY_STOP:int = 40;
public static const EGGE_BIRD_STOP:int = 26;
public static const EGGE_BIRD_DIAMOND_MOVE:int = 44;
public static const EGGE_BIRD_CEP_ID:int = 10002;
public static const BLOW4_ANIM:int = 21;
public static const EGGE_BIRD_MONEY_DELETE:int = 42;
public static const EGGE_BIRD_DIAMOND_STOP:int = 43;
public static const ROT2_ANIM:int = 5;
public static const DUST_ANIM:int = 24;
public static const FLUSH_ANIM:int = 17;
public static const BLOW1_ANIM:int = 18;
public static const ROT_ANIM:int = 4;
public static const EGGE_BIRD_DIAMONDS_ID:int = 10004;
public static const EGGE_BIRD_DIAMOND_DELETE:int = 45;
public static const PREPARE_FOR_FLY_ANIM:int = 11;
public static const FLY_FROM_KATAPULTA_ANIM:int = 8;
public static const STROKE_ANIM:int = 9;
public static const DISTANCE_BETWEEN_BIRD:Number = 40;
public static const ID_BOMBA:int = 66;
public static const MOVE_ANIM:int = 1;
public static const HOOK_OPEN_ANIM:int = 13;
public static const BLOW3_ANIM:int = 20;
public static const TRUS_ANIM:int = 3;
public static const EXPLODE_ANIM:int = 23;
public static const IN_RAD:Number = 0.017453292519;
public static const EGGE_BIRD_MONEY_ID:int = 10003;
public static const EGGE_BIRD_CEP_DELETE:int = 39;
public static const HOOK_CLOSED_ANIM:int = 15;
public static const FREE_FLY_ANIM:int = 12;
public static const FLY_IN_CROWD_ANIM:int = 10;
public static const IDL_ANIM:int = 0;
public static var anim_id:int = 0;
public static var isRenderToTargetForCurrGame:Boolean = false;
public static var back1:BitmapData;
public static var back2:BitmapData;
public static var back3:BitmapData;
public static var rotate:Number = 0;
public static var bird_id:int = 0;
public static var tilesManager:V_TilesManager = new V_TilesManager();
public static var x:Number = 0;
public static var y:Number = 0;
public static var anims:Array = new Array();
public static var flag_render_to_target:Boolean = false;
public function V_Utility(){
super();
}
public static function addAnim(anim:V_Anim):void{
anims.push(anim);
}
public static function traceByteArray(ref:ByteArray):void{
var t:int;
ref.position = 0;
var str:String = "";
var i:uint;
while (i < ref.length) {
t = ref.readByte();
str = (str + (t.toString() + "#"));
i++;
};
trace(str);
}
public static function Random_Int(min:int, max:int):int{
return ((min + Math.round((Math.random() * (max - min)))));
}
public static function getAnim(num:int):V_Anim{
return (anims[num]);
}
public static function Random_Float(min:Number, max:Number):Number{
return ((min + (Math.random() * (max - min))));
}
public static function distance(x1:Number, y1:Number, x2:Number, y2:Number):Number{
return (Math.sqrt((((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))));
}
}
}//package