home *** CD-ROM | disk | FTP | other *** search
- class illusoft.GameTile008 extends illusoft.GameTile
- {
- var levelComplete;
- var dmc;
- var character;
- var r1;
- var r2;
- var r3;
- var r4;
- var r5;
- var r0;
- var dynamicsEngine;
- var game;
- var gameMC;
- var surfaces;
- var StartRunHide;
- var Enemy;
- var b2;
- var b1;
- var b3;
- function GameTile008(id, dEngine, character, game, gamemc, nextLevel)
- {
- super(id,dEngine,character,game,gamemc,nextLevel);
- }
- function Update(x, y)
- {
- super.Update(x);
- if(!this.levelComplete)
- {
- if(x > 2350 && y > 800)
- {
- _global.sounds.LoopSound("jetstream",60);
- }
- else
- {
- _global.sounds.FadeVolume("jetstream",false,false);
- }
- if(this.character.dmc.hitTest(this.dmc.bird1.sou) && this.dmc.bird1._visible || this.character.dmc.hitTest(this.dmc.bird2.sou) && this.dmc.bird2._visible || this.character.dmc.hitTest(this.dmc.bird3.sou) && this.dmc.bird3._visible)
- {
- _global.sounds.LoopSound("niao",100);
- }
- else
- {
- _global.sounds.FadeVolume("niao",false,false);
- }
- }
- this.r1.RunHide(60,90);
- this.r2.RunHide(60,90);
- this.r3.RunHide(60,90);
- this.r4.RunHide(60,90);
- this.r5.RunHide(60,90);
- this.r0.RunHide(60,90);
- if(this.character.dmc.hitTest(this.dmc.sleft))
- {
- this.dynamicsEngine.setGravity(-3,0);
- }
- else
- {
- this.game.NormalGravity();
- }
- }
- function Init()
- {
- super.Init();
- var ca = this.character;
- this.r0 = new org.cove.flade.surfaces.MoveRectangleTile(2035.9,833.2,200,50,this.gameMC);
- this.r1 = new org.cove.flade.surfaces.MoveRectangleTile(2284.4,975.6,200,50,this.gameMC);
- this.r2 = new org.cove.flade.surfaces.MoveRectangleTile(2586.9,874.1,200,100,this.gameMC);
- this.r3 = new org.cove.flade.surfaces.MoveRectangleTile(2855.6,742.8,200,100,this.gameMC);
- this.r4 = new org.cove.flade.surfaces.MoveRectangleTile(3213.2,603.6,200,100,this.gameMC);
- this.r5 = new org.cove.flade.surfaces.MoveRectangleTile(3461.6,767.8,140,100,this.gameMC);
- this.surfaces.push(this.r0);
- this.surfaces.push(this.r1);
- this.surfaces.push(this.r2);
- this.surfaces.push(this.r3);
- this.surfaces.push(this.r4);
- this.surfaces.push(this.r5);
- this.r1.onContact = function()
- {
- ca.AllowJump(true);
- this.StartRunHide(true);
- };
- var cref = this;
- this.r0.onMoveHide = function()
- {
- cref.dmc.cloud0.play();
- };
- this.r0.onMoveShow = function()
- {
- cref.dmc.cloud0.gotoAndStop(1);
- };
- this.r1.onMoveHide = function()
- {
- cref.dmc.cloud1.play();
- };
- this.r1.onMoveShow = function()
- {
- cref.dmc.cloud1.gotoAndStop(1);
- };
- this.r2.onMoveHide = function()
- {
- cref.dmc.cloud2.play();
- };
- this.r2.onMoveShow = function()
- {
- cref.dmc.cloud2.gotoAndStop(1);
- };
- this.r3.onMoveHide = function()
- {
- cref.dmc.cloud3.play();
- };
- this.r3.onMoveShow = function()
- {
- cref.dmc.cloud3.gotoAndStop(1);
- };
- this.r4.onMoveHide = function()
- {
- cref.dmc.cloud4.play();
- };
- this.r4.onMoveShow = function()
- {
- cref.dmc.cloud4.gotoAndStop(1);
- };
- this.r5.onMoveHide = function()
- {
- cref.dmc.cloud5.play();
- };
- this.r5.onMoveShow = function()
- {
- cref.dmc.cloud5.gotoAndStop(1);
- };
- this.r2.onContact = this.r3.onContact = this.r4.onContact = this.r5.onContact = this.r0.onContact = this.r1.onContact;
- this.dynamicsEngine.addSurface(this.r0);
- this.dynamicsEngine.addSurface(this.r1);
- this.dynamicsEngine.addSurface(this.r2);
- this.dynamicsEngine.addSurface(this.r3);
- this.dynamicsEngine.addSurface(this.r4);
- this.dynamicsEngine.addSurface(this.r5);
- this.Enemy = "bird1/bird2/bird3";
- this.dmc.sleft._visible = false;
- var _loc4_ = new Array();
- _loc4_.push(new huang.HUFO(2409.35,790.3,0,50));
- _loc4_.push(new huang.HUFO(2409.35,790.3,0,50));
- _loc4_.push(new huang.HUFO(2420.6,1012.9,0,50));
- _loc4_.push(new huang.HUFO(2420.6,1012.9,0,50));
- _loc4_.push(new huang.HUFO(2409.35,790.3,0,50));
- this.b2 = new huang.HAnimation(this.dmc + ".bird1",_loc4_);
- _loc4_ = new Array();
- _loc4_.push(new huang.HUFO(3012,822.85,0,50));
- _loc4_.push(new huang.HUFO(3012,822.85,0,50));
- _loc4_.push(new huang.HUFO(3002,515.2,0,50));
- _loc4_.push(new huang.HUFO(3002,515.2,0,50));
- _loc4_.push(new huang.HUFO(3012,822.85,0,50));
- this.b1 = new huang.HAnimation(this.dmc + ".bird2",_loc4_);
- _loc4_ = new Array();
- _loc4_.push(new huang.HUFO(3338.35,527.7,0,50));
- _loc4_.push(new huang.HUFO(3338.35,527.7,0,50));
- _loc4_.push(new huang.HUFO(3455.85,527.7,0,50));
- _loc4_.push(new huang.HUFO(3455.85,527.7,0,50));
- _loc4_.push(new huang.HUFO(3338.35,527.7,0,50));
- this.b3 = new huang.HAnimation(this.dmc + ".bird3",_loc4_);
- this.b1.vloop = this.b2.vloop = this.b3.vloop = "all";
- _global.sounds.StartMusic("loop3");
- this.dmc.roundedRect0._visible = this.dmc.roundedRect1._visible = this.dmc.roundedRect2._visible = false;
- this.dmc.roundedRect3._visible = this.dmc.roundedRect4._visible = this.dmc.roundedRect5._visible = false;
- this.dmc.roundedRect3._visible = false;
- }
- function Start()
- {
- super.Start();
- this.b1.Start();
- this.b2.Start();
- this.b3.Start();
- this.r0.SetMoveAspect(false);
- this.r1.SetMoveAspect(false);
- this.r2.SetMoveAspect(false);
- this.r3.SetMoveAspect(false);
- this.r4.SetMoveAspect(false);
- this.r5.SetMoveAspect(false);
- }
- function Close()
- {
- _global.sounds.FadeVolume("jetstream",false,false);
- _global.sounds.FadeVolume("niao",false,false);
- super.Close();
- this.b1.Close();
- this.b2.Close();
- this.b3.Close();
- }
- function LevelComplete()
- {
- this.levelComplete = true;
- _global.sounds.FadeVolume("jetstream",false,false);
- _global.sounds.FadeVolume("niao",false,false);
- }
- }
-