home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / batman_cobble.swf / scripts / frame_16 / DoAction_8.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1.2 KB  |  48 lines

  1. _global.cameraLogic4 = function()
  2. {
  3.    _root.frameCount = _root.frameCount + 1;
  4.    if(_root.frameCount > 15 && !_root.fpsSet)
  5.    {
  6.       this.tick = getTimer() - this.lastTime;
  7.       _root.FPS = int(1 / this.tick * 1000 * _root.frameCount);
  8.       _root.frameCount = 0;
  9.       this.lastTime = getTimer();
  10.    }
  11.    if(_root.playerDir > 0)
  12.    {
  13.       var _loc5_ = 125;
  14.    }
  15.    else
  16.    {
  17.       _loc5_ = 475;
  18.    }
  19.    var _loc7_ = 300;
  20.    var _loc3_ = _root.game.player._x + this._x;
  21.    var _loc6_ = _root.game.player._y + this._y;
  22.    if(_root.game.player._x > _root.camMin && _root.game.player._x < _root.camMax)
  23.    {
  24.       if(Math.abs(_loc3_ - _loc5_) > 1)
  25.       {
  26.          var _loc4_ = int((_loc3_ - _loc5_) / 10);
  27.          this._x -= _loc4_;
  28.          _root.bgScroll += _loc4_ / 2;
  29.          if(this._x < -300)
  30.          {
  31.             this._x = -300;
  32.          }
  33.          else if(this._x > 150)
  34.          {
  35.             this._x = 150;
  36.          }
  37.       }
  38.    }
  39.    if(_root.playerJumping)
  40.    {
  41.       this._y = (_root.camHeight - this.player._y) / _root.camJump;
  42.    }
  43.    else if(Math.abs(this._y + this.player._y - 150) > 1)
  44.    {
  45.       this._y += int(((_root.camHeight - this.player._y) / _root.camJump - this._y) / 4);
  46.    }
  47. };
  48.