home *** CD-ROM | disk | FTP | other *** search
- class illusoft.GameTile014 extends illusoft.GameTile
- {
- var levelComplete;
- var dmc;
- var character;
- var Enemy;
- var lastTime = 0;
- function GameTile014(id, dEngine, character, game, gamemc, nextLevel)
- {
- super(id,dEngine,character,game,gamemc,nextLevel);
- }
- function Update(x)
- {
- super.Update(x);
- if(!this.levelComplete)
- {
- if(this.character.dmc.hitTest(this.dmc.b2.sou) && this.dmc.b2._visible || this.character.dmc.hitTest(this.dmc.b3.sou) && this.dmc.b3._visible || this.character.dmc.hitTest(this.dmc.b4.sou) && this.dmc.b4._visible || this.character.dmc.hitTest(this.dmc.b5.sou) && this.dmc.b5._visible)
- {
- _global.sounds.LoopSound("niao",100);
- }
- else
- {
- _global.sounds.FadeVolume("niao",false,false);
- }
- }
- this.Reject();
- }
- function Reject()
- {
- var i = 1;
- while(i < 13)
- {
- var temp = eval(this.dmc + ".mg" + i);
- var nt = new Date().getTime();
- if(this.character.dmc.hitTest(temp.myH))
- {
- temp.gotoAndPlay(2);
- if(nt - this.lastTime > 200)
- {
- _global.sounds.PlaySound("boing3");
- this.lastTime = nt;
- }
- this.character.ConstrainJump(15);
- }
- if(this.character.dmc.hitTest(temp))
- {
- if(Key.isDown(38) || Key.isDown(32))
- {
- if(nt - this.lastTime > 100)
- {
- _global.sounds.PlaySound("jippie2");
- this.lastTime = nt;
- }
- this.character.ConstrainJump(40);
- }
- }
- i++;
- }
- }
- function Init()
- {
- super.Init();
- _global.sounds.StartMusic("loop2");
- this.Enemy = "b2/b3/b4/b5";
- this.lastTime = new Date().getTime();
- this.dmc.mg12 = this.dmc.mgN.mgin;
- }
- function Close()
- {
- _global.sounds.FadeVolume("niao",false,false);
- super.Close();
- }
- function LevelComplete()
- {
- this.levelComplete = true;
- _global.sounds.FadeVolume("niao",false,false);
- }
- }
-