System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Node, _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _crd, ccclass, property, game_manger;

  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }

  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }

  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      Node = _cc.Node;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "24d93JEiZFIBJXy+ES4BU1L", "moving-scene-bg", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("game_manger", game_manger = (_dec = ccclass('game_manger'), _dec2 = property(Node), _dec3 = property(Node), _dec(_class = (_class2 = class game_manger extends Component {
        constructor() {
          super(...arguments);

          _initializerDefineProperty(this, "bg01", _descriptor, this);

          _initializerDefineProperty(this, "bg02", _descriptor2, this);

          // 移动速度
          this._bgSpeed = 10;
          // 偏移量
          this._bgMovingRange = 50;
        }

        onLoad() {}

        start() {
          this._init();
        }

        update(deltaTime) {
          this._moveBackground(deltaTime);
        }

        _init() {
          this.bg01.setPosition(0, 0, 0);
          this.bg02.setPosition(-this._bgMovingRange, 0, 0);
        }

        _moveBackground(deltaTime) {
          this.bg01.setPosition(this.bg01.position.x + this._bgSpeed * deltaTime, 0, 0);
          this.bg02.setPosition(this.bg02.position.x + this._bgSpeed * deltaTime, 0, 0);

          if (this.bg01.position.x > this._bgMovingRange) {
            this.bg01.setPosition(this.bg02.position.x - this._bgMovingRange, 0, 0);
          } else if (this.bg02.position.x > this._bgMovingRange) {
            this.bg02.setPosition(this.bg01.position.x - this._bgMovingRange, 0, 0);
          }
        }

      }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "bg01", [_dec2], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return null;
        }
      }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "bg02", [_dec3], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return null;
        }
      })), _class2)) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=a2b526e8e7b91c30a4531afbaa41340d19438e11.js.map