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

  var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, instantiate, Prefab, Vec3, _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _crd, ccclass, property, GameManager;

  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;
      instantiate = _cc.instantiate;
      Prefab = _cc.Prefab;
      Vec3 = _cc.Vec3;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "d9553JeOoBP3ZoIaWiNi0lv", "GameManager", undefined);

      __checkObsolete__(['_decorator', 'Component', 'instantiate', 'Node', 'Prefab', 'Vec3']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("GameManager", GameManager = (_dec = ccclass('GameManager'), _dec2 = property(Prefab), _dec3 = property(Prefab), _dec4 = property(Prefab), _dec(_class = (_class2 = class GameManager extends Component {
        constructor(...args) {
          super(...args);

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

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

          _initializerDefineProperty(this, "treePrefab", _descriptor3, this);
        }

        onLoad() {
          for (let i = 0; i < 100; i++) {
            const instantiatedNode = instantiate(this.roadPrefab);
            instantiatedNode.setPosition(0, 0, i * -10);
            this.node.addChild(instantiatedNode); //coin generation

            const instantiatedCoin = instantiate(this.coinPrefab);
            const options = [3.5, 0, -3.5];
            const randomNumber = this.getRandomNumber(options);
            instantiatedCoin.setPosition(randomNumber, 2, i * -10);
            this.node.addChild(instantiatedCoin);
          }

          for (let b = 0; b < 100; b++) {
            //left side of the road
            const instantiatedTree = instantiate(this.treePrefab);
            const options2 = [-6.5, -6.8, -7, -7.3, -7.5];
            const randomNumber2 = this.getRandomNumber(options2);
            instantiatedTree.setPosition(randomNumber2, 0, b * -10);
            const randomInteger = Math.floor(Math.random() * 360);
            const rotationEuler = new Vec3(0, randomInteger, 0);
            instantiatedTree.setRotationFromEuler(rotationEuler);
            this.node.addChild(instantiatedTree); //right side of the road

            const instantiatedTree2 = instantiate(this.treePrefab);
            const options3 = [6.5, 6.8, 7, 7.3, 7.5];
            const randomNumber3 = this.getRandomNumber(options3);
            instantiatedTree2.setPosition(randomNumber3, 0, b * -10);
            const randomInteger2 = Math.floor(Math.random() * 360);
            const rotationEuler2 = new Vec3(0, randomInteger2, 0);
            instantiatedTree2.setRotationFromEuler(rotationEuler2);
            this.node.addChild(instantiatedTree2);
          }
        }

        getRandomNumber(options) {
          const randomIndex = Math.floor(Math.random() * options.length);
          return options[randomIndex];
        }

        start() {}

        update(deltaTime) {}

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

      _cclegacy._RF.pop();

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