
cc.Class({
    extends: cc.Component,

    properties: {

        camera: cc.Node,
        isRuning:{
            default:false,
            serializable:true,
        }
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        this.camera = cc.find("Canvas/Main Camera");
    },

    update (dt) {
   
        if(this.isRuning&&GLOBAL_DATA.GAME.gameRuning)
        {
            // this.camera.x += dt*GLOBAL_DATA.GAME.gameSpeed;
            if(this.camera.x>=this.node.x+720){
                this.node.x = this.camera.x;
            }
          
        }
    },
});
