home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / starisland.swf / scripts / __Packages / illusoft / GameTile003.as < prev    next >
Encoding:
Text File  |  2007-12-10  |  1.7 KB  |  62 lines

  1. class illusoft.GameTile003 extends illusoft.GameTile
  2. {
  3.    var gameMC;
  4.    var surfaces;
  5.    var dynamicsEngine;
  6.    var dmc;
  7.    var aniDone = false;
  8.    function GameTile003(id, dEngine, character, game, gamemc, nextLevel)
  9.    {
  10.       super(id,dEngine,character,game,gamemc,nextLevel);
  11.    }
  12.    function Update(x)
  13.    {
  14.       super.Update(x);
  15.    }
  16.    function Init()
  17.    {
  18.       super.Init();
  19.       var _loc4_ = new illusoft.utils.RectangleCheck(546,680,40,35,this.gameMC);
  20.       this.surfaces.push(_loc4_);
  21.       var cref = this;
  22.       _loc4_.onContact = function()
  23.       {
  24.          if(!cref.aniDone)
  25.          {
  26.             cref.dmc.level3ani.play();
  27.             _global.sounds.PlaySound("door");
  28.             cref.game.listenForKeys = false;
  29.             cref.character.dmc._visible = false;
  30.             cref.aniDone = true;
  31.             cref.game.camYSpeed = 0.1;
  32.             cref.game.camXSpeed = 0.1;
  33.          }
  34.          cref.character.AllowJump(false);
  35.       };
  36.       this.dynamicsEngine.addSurface(_loc4_);
  37.       this.aniDone = false;
  38.       this.dmc.level3ani.gotoAndStop(1);
  39.       this.dmc.level3ani.AniDone = function()
  40.       {
  41.          cref.game.listenForKeys = true;
  42.          cref.character.dmc._visible = true;
  43.          cref.game.camYSpeed = 0.3;
  44.          cref.game.camXSpeed = 0.2;
  45.          var _loc1_ = cref.character.dmc;
  46.          _loc1_._x = 1430;
  47.          _loc1_._y = 1100;
  48.          cref.character.SetMC(_loc1_);
  49.       };
  50.       this.dmc.level3ani.SetCam = function(x, y)
  51.       {
  52.          cref.game.worldPos.x += x;
  53.          cref.game.worldPos.y += y;
  54.       };
  55.       _global.sounds.StartMusic("loop1");
  56.    }
  57.    function Close()
  58.    {
  59.       super.Close();
  60.    }
  61. }
  62.