home *** CD-ROM | disk | FTP | other *** search
Wrap
class illusoft.GameTile015 extends illusoft.GameTile { var lastTime; var character; var dmc; var Enemy; var gameMC; var surfaces; var dynamicsEngine; var levelComplete; var aniDone = false; var Hit2 = false; function GameTile015(id, dEngine, character, game, gamemc, nextLevel) { super(id,dEngine,character,game,gamemc,nextLevel); this.lastTime = new Date().getTime(); } function Update(x) { super.Update(x); var _loc5_ = this.character.dmc; var _loc4_ = new Date().getTime(); if(_loc5_.hitTest(this.dmc.myHitter1)) { trace("myHitter1"); this.dmc.myHitter1._y = -100; this.dmc.mole_go1.play(); } if(_loc5_.hitTest(this.dmc.myHitter2)) { trace("myHitter2"); this.dmc.myHitter2._y = -100; this.dmc.mole_go2.play(); } if(this.Hit2 && _loc5_.hitTest(this.dmc.myHitter3)) { trace("myHitter3"); this.dmc.myHitter3._y = -100; this.dmc.mole_go4.play(); } if(_loc5_.hitTest(this.dmc.bomb1)) { this.dmc.bomb1.play(); if(_loc4_ - this.lastTime > 500) { _global.sounds.PlaySound("explode"); this.lastTime = _loc4_; } this.character.MoveUp(8); } else if(_loc5_.hitTest(this.dmc.bomb2)) { this.dmc.bomb2.play(); this.character.MoveUp(16); if(_loc4_ - this.lastTime > 500) { _global.sounds.PlaySound("explode"); this.lastTime = _loc4_; } } else if(_loc5_.hitTest(this.dmc.bomb4)) { this.dmc.bomb4.play(); this.character.MoveUp(12); if(_loc4_ - this.lastTime > 500) { _global.sounds.PlaySound("explode"); this.lastTime = _loc4_; } } else if(_loc5_.hitTest(this.dmc.button1)) { this.character.MoveUp(22); if(_loc4_ - this.lastTime > 500) { _global.sounds.PlaySound("boing"); this.lastTime = _loc4_; } } } function Init() { super.Init(); this.Enemy = "mole_go1/mole_go2/mole_go4"; var _loc4_ = new illusoft.utils.RectangleCheck(this.dmc.roundedRect00._x,this.dmc.roundedRect00._y,this.dmc.roundedRect00._width,this.dmc.roundedRect00._height,this.gameMC); this.surfaces.push(_loc4_); var cref = this; _loc4_.onContact = function() { if(!cref.aniDone) { cref.dmc.level3ani.play(); _global.sounds.PlaySound("door"); cref.game.listenForKeys = false; cref.character.dmc._visible = false; cref.aniDone = true; cref.game.camYSpeed = 0.1; cref.game.camXSpeed = 0.1; } cref.character.AllowJump(false); }; this.dynamicsEngine.addSurface(_loc4_); this.aniDone = false; this.dmc.level3ani.gotoAndStop(1); this.dmc.level3ani.AniDone = function() { cref.game.listenForKeys = true; cref.character.dmc._visible = true; cref.game.camYSpeed = 0.3; cref.game.camXSpeed = 0.2; var _loc1_ = cref.character.dmc; _loc1_._x = 380; _loc1_._y = 705; cref.character.SetMC(_loc1_); }; this.dmc.level3ani.SetCam = function(x, y) { cref.game.worldPos.x += x; cref.game.worldPos.y += y; }; this.dmc.mole_go1.runstart = function() { trace("a"); _global.sounds.LoopSound("bs",100); }; this.dmc.mole_go1.runstop = function() { _global.sounds.FadeVolume("bs",false,false); }; this.dmc.mole_go2.runstart = function() { _global.sounds.LoopSound("bs",100); }; this.dmc.mole_go2.runstop = function() { _global.sounds.FadeVolume("bs",false,false); }; this.dmc.mole_go3.runstart = function() { _global.sounds.LoopSound("bs",100); }; this.dmc.mole_go3.runstop = function() { _global.sounds.FadeVolume("bs",false,false); }; this.dmc.mole_go2.Hit2 = function() { trace("Hit2"); cref.Hit2 = true; }; _global.sounds.StartMusic("loop3"); } function Close() { _global.sounds.FadeVolume("bs",false,false); super.Close(); } function LevelComplete() { this.levelComplete = true; _global.sounds.FadeVolume("bs",false,false); } }