home *** CD-ROM | disk | FTP | other *** search
- _global.cameraLogic4 = function()
- {
- _root.frameCount = _root.frameCount + 1;
- if(_root.frameCount > 15 && !_root.fpsSet)
- {
- this.tick = getTimer() - this.lastTime;
- _root.FPS = int(1 / this.tick * 1000 * _root.frameCount);
- _root.frameCount = 0;
- this.lastTime = getTimer();
- }
- if(_root.playerDir > 0)
- {
- var _loc5_ = 125;
- }
- else
- {
- _loc5_ = 475;
- }
- var _loc7_ = 300;
- var _loc3_ = _root.game.player._x + this._x;
- var _loc6_ = _root.game.player._y + this._y;
- if(_root.game.player._x > _root.camMin && _root.game.player._x < _root.camMax)
- {
- if(Math.abs(_loc3_ - _loc5_) > 1)
- {
- var _loc4_ = int((_loc3_ - _loc5_) / 10);
- this._x -= _loc4_;
- _root.bgScroll += _loc4_ / 2;
- if(this._x < -300)
- {
- this._x = -300;
- }
- else if(this._x > 150)
- {
- this._x = 150;
- }
- }
- }
- if(_root.playerJumping)
- {
- this._y = (_root.camHeight - this.player._y) / _root.camJump;
- }
- else if(Math.abs(this._y + this.player._y - 150) > 1)
- {
- this._y += int(((_root.camHeight - this.player._y) / _root.camJump - this._y) / 4);
- }
- };
-