app/data/ct.release/camera.js
/**
     * Updates the position of the camera
     * @param {number} delta A delta value between the last two frames. This is usually ct.delta.
     * @returns {void}
     */
Updates the position of the camera
@param {number} delta A delta value between the last two frames.
Updates the position of the camera @param { number } delta A delta value between the last two frames .
update(delta) {
        if (this.follow && this.follow.kill) {
            this.follow = false;
        }
        const sec = delta / (PIXI.Ticker.shared.maxFPS || 60);
        this.shake -= sec * this.shakeDecay;
        this.shake = Math.max(0, this.shake);
        if (this.shakeMax) {
            this.shake = Math.min(this.shake, this.shakeMax);
        }
        this.shakePhase += sec * this.shakeFrequency;
        this.shakePhaseX += sec * this.shakeFrequency * (1 + Math.sin(this.shakePhase * 0.1489) * 0.25); 
        this.shakePhaseY += sec * this.shakeFrequency * (1 + Math.sin(this.shakePhase * 0.1734) * 0.25); 
        const speed = this.drift? Math.min(1, (1-this.drift)*delta) : 1;
        if (this.follow && ('x' in this.follow) && ('y' in this.follow)) {
            const bx = this.borderX === null? this.width / 2 : Math.min(this.borderX, this.width / 2),
                  by = this.borderY === null? this.height / 2 : Math.min(this.borderY, this.height / 2);
            const tl = this.uiToGameCoord(bx, by),
                  br = this.uiToGameCoord(this.width - bx, this.height - by);
            if (this.follow.x < tl[0] - this.interpolatedShiftX) {
                this.targetX = this.follow.x - bx + this.width / 2;
            } else if (this.follow.x > br[0] - this.interpolatedShiftX) {
                this.targetX = this.follow.x + bx - this.width / 2;
            }
            if (this.follow.y < tl[1] - this.interpolatedShiftY) {
                this.targetY = this.follow.y - by + this.height / 2;
            } else if (this.follow.y > br[1] - this.interpolatedShiftY) {
                this.targetY = this.follow.y + by - this.height / 2;
            }
        }
        this.x = this.targetX * speed + this.x * (1-speed);
        this.y = this.targetY * speed + this.y * (1-speed);
        this.interpolatedShiftX = this.shiftX * speed + this.interpolatedShiftX * (1-speed);
        this.interpolatedShiftY = this.shiftY * speed + this.interpolatedShiftY * (1-speed);
        this.x = this.x || 0;
        this.y = this.y || 0;
    }
update ( delta ) { if ( this . follow && this . follow . kill ) { this . follow = false ; } const sec = delta / ( PIXI . Ticker . shared . maxFPS || 60 ) ; this . shake -= sec * this . shakeDecay ; this . shake = Math . max ( 0 , this . shake ) ; if ( this . shakeMax ) { this . shake = Math . min ( this . shake , this . shakeMax ) ; } this . shakePhase += sec * this . shakeFrequency ; this . shakePhaseX += sec * this . shakeFrequency * ( 1 + Math . sin ( this . shakePhase * 0.1489 ) * 0.25 ) ; this . shakePhaseY += sec * this . shakeFrequency * ( 1 + Math . sin ( this . shakePhase * 0.1734 ) * 0.25 ) ; const speed = this . drift ? Math . min ( 1 , ( 1 - this . drift ) * delta ) : 1 ; if ( this . follow && ( 'x' in this . follow ) && ( 'y' in this . follow ) ) { const bx = this . borderX === null ? this . width / 2 : Math . min ( this . borderX , this . width / 2 ) , by = this . borderY === null ? this . height / 2 : Math . min ( this . borderY , this . height / 2 ) ; const tl = this . uiToGameCoord ( bx , by ) , br = this . uiToGameCoord ( this . width - bx , this . height - by ) ; if ( this . follow . x < tl [ 0 ] - this . interpolatedShiftX ) { this . targetX = this . follow . x - bx + this . width / 2 ; } else if ( this . follow . x > br [ 0 ] - this . interpolatedShiftX ) { this . targetX = this . follow . x + bx - this . width / 2 ; } if ( this . follow . y < tl [ 1 ] - this . interpolatedShiftY ) { this . targetY = this . follow . y - by + this . height / 2 ; } else if ( this . follow . y > br [ 1 ] - this . interpolatedShiftY ) { this . targetY = this . follow . y + by - this . height / 2 ; } } this . x = this . targetX * speed + this . x * ( 1 - speed ) ; this . y = this . targetY * speed + this . y * ( 1 - speed ) ; this . interpolatedShiftX = this . shiftX * speed + this . interpolatedShiftX * ( 1 - speed ) ; this . interpolatedShiftY = this . shiftY * speed + this . interpolatedShiftY * ( 1 - speed ) ; this . x = this . x || 0 ; this . y = this . y || 0 ; }
Updates the position of the camera
 @param {number} delta A delta value between the last two frames.
Updates the position of the camera @param { number } delta A delta value between the last two frames .
// no logic in these constants // They are used to desync fluctuations and remove repetitive circular movements // The speed of drift movement