home *** CD-ROM | disk | FTP | other *** search
- class illusoft.GameTile004 extends illusoft.GameTile
- {
- var levelComplete;
- var character;
- var dmc;
- var dynamicsEngine;
- var game;
- function GameTile004(id, dEngine, character, game, gamemc, nextLevel)
- {
- super(id,dEngine,character,game,gamemc,nextLevel);
- }
- function Update(x)
- {
- super.Update(x);
- if(!this.levelComplete)
- {
- if(x > 950 && x < 2100)
- {
- _global.sounds.LoopSound("waterpao",100);
- }
- else
- {
- _global.sounds.FadeVolume("waterpao",false,false);
- }
- }
- var _loc4_ = this.character.dmc;
- if(_loc4_.hitTest(this.dmc.square1))
- {
- this.dynamicsEngine.setGravity(0,5);
- }
- else if(_loc4_.hitTest(this.dmc.square2) || _loc4_.hitTest(this.dmc.square4) || _loc4_.hitTest(this.dmc.square7))
- {
- this.dynamicsEngine.setGravity(-3.5,1.9);
- }
- else if(_loc4_.hitTest(this.dmc.square3) || _loc4_.hitTest(this.dmc.square5) || _loc4_.hitTest(this.dmc.square6))
- {
- this.dynamicsEngine.setGravity(3.5,1.9);
- }
- else if(_loc4_.hitTest(this.dmc.square8))
- {
- this.dynamicsEngine.setGravity(0,-3.5);
- }
- else
- {
- this.game.NormalGravity();
- }
- }
- function Close()
- {
- _global.sounds.FadeVolume("waterpao",false,false);
- super.Close();
- }
- function LevelComplete()
- {
- this.levelComplete = true;
- _global.sounds.FadeVolume("waterpao",false,false);
- }
- function Init()
- {
- super.Init();
- _global.sounds.StartMusic("loop4");
- this.game.SetUnderWater(true);
- var cref = this;
- var _loc4_ = 1;
- while(_loc4_ <= 8)
- {
- this.dmc["square" + _loc4_]._visible = false;
- _loc4_ = _loc4_ + 1;
- }
- this.dmc.ani.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 = 784.3;
- _loc1_._y = 1020.3;
- cref.character.SetMC(_loc1_);
- };
- this.dmc.ani.SetCam = function(x, y)
- {
- cref.game.worldPos.x += x;
- cref.game.worldPos.y += y;
- };
- }
- function Start()
- {
- super.Start();
- this.game.listenForKeys = false;
- this.character.dmc._visible = false;
- }
- }
-