<commit_before>define('page/GamePage', [
  'goo/entities/GooRunner',
  'component/CameraComponent',
  'component/SunComponent',
  'component/FinalZoneComponent',
  'component/FuelZoneComponent',
  'component/StarshipComponent',
  'helper/DomHelper',
  'helper/ShootHelper',
  'page/PausePage',
  'manager/EntityManager',
  'util/MapUtil',
  'util/RadarUtil',
  'util/OptionsUtil'
], function(
  GooRunner,
  CameraComponent,
  SunComponent,
  FinalZoneComponent,
  FuelZoneComponent,
  StarshipComponent,
  DomHelper,
  ShootHelper,
  PausePage,
  EntityManager,
  MapUtil,
  RadarUtil,
  OptionsUtil) {

    var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
    var screenHeight = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

    var backCallback;
    var canvas;
    var pauseButton;
    var crosschair;
    var fuelDiv;

    var fuelZone;
    var camera;

    function build() {
      DomHelper.clearPageContent();
      DomHelper.hidePage();
      crosschair = DomHelper.addCrosschair();
      fuelDiv = DomHelper.addFuelAmount(screenHeight - (screenHeight * 0.5));
      fuelDiv.update(100);
      var goo = startGame();
      var isRunningGame = true;
      pauseButton = DomHelper.buildButton('', function(e) {
        if(isRunningGame) {
          goo.stopGameLoop();
          isRunningGame = false;
          elementsDomVisible(false);
          PausePage.show(function() {
            DomHelper.clearPageContent();
            DomHelper.hidePage();
            var w = screenWidth * OptionsUtil.get('screenSize');
            var h = screenHeight * OptionsUtil.get('screenSize');
            goo.renderer.setSize(w, h);
            goo.startGameLoop();
            isRunningGame = true;
            elementsDomVisible(true);
          });
          DomHelper.showPage();
        } else {
          goo.startGameLoop();
          isRunningGame = true;
        }
      });
      pauseButton.classList.add('pause');
      document.body.appendChild(pauseButton);
    }

    var elementsDomVisible = function elementsDomVisible(bool) {
      for(var i=0, len=document.body.children.length; i<len; i++) {
        document.body.children[i].style.display = ((bool === false) ? 'none' : 'block');
      }
    };

    var startGame = function startGame() {
      var goo = new GooRunner();
      var w = screenWidth * OptionsUtil.get('screenSize');
      var h = screenHeight * OptionsUtil.get('screenSize');
      canvas = goo.renderer.domElement;
      canvas.classList.add('canvas');
      goo.renderer.setSize(w, h);
      goo.renderer.setClearColor(0, 0, 0, 1);
      document.body.appendChild(canvas);
      
      var sun = new SunComponent(goo.world, true);

      fuelZone = new FuelZoneComponent(goo.world, true);

      //new StarshipComponent(goo.world, true);
      
      camera = new CameraComponent(
        goo.world, <commit_msg>create function to update scene size<commit_after>define('page/GamePage', [
  'goo/entities/GooRunner',
  'component/CameraComponent',
  'component/SunComponent',
  'component/FinalZoneComponent',
  'component/FuelZoneComponent',
  'component/StarshipComponent',
  'helper/DomHelper',
  'helper/ShootHelper',
  'page/PausePage',
  'manager/EntityManager',
  'util/MapUtil',
  'util/RadarUtil',
  'util/OptionsUtil'
], function(
  GooRunner,
  CameraComponent,
  SunComponent,
  FinalZoneComponent,
  FuelZoneComponent,
  StarshipComponent,
  DomHelper,
  ShootHelper,
  PausePage,
  EntityManager,
  MapUtil,
  RadarUtil,
  OptionsUtil) {

    var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
    var screenHeight = window.innerHeight|| document.documentElement.clientHeight|| document.getElementsByTagName('body')[0].clientHeight;

    var backCallback;
    var canvas;
    var pauseButton;
    var crosschair;
    var fuelDiv;

    var fuelZone;
    var camera;

    function build() {
      DomHelper.clearPageContent();
      DomHelper.hidePage();
      crosschair = DomHelper.addCrosschair();
      fuelDiv = DomHelper.addFuelAmount(screenHeight - (screenHeight * 0.5));
      fuelDiv.update(100);
      var goo = startGame();
      var isRunningGame = true;
      pauseButton = DomHelper.buildButton('', function(e) {
        if(isRunningGame) {
          goo.stopGameLoop();
          isRunningGame = false;
          elementsDomVisible(false);
          PausePage.show(function() {
            DomHelper.clearPageContent();
            DomHelper.hidePage();
            updateSceneSize(goo);
            goo.startGameLoop();
            isRunningGame = true;
            elementsDomVisible(true);
          });
          DomHelper.showPage();
        } else {
          goo.startGameLoop();
          isRunningGame = true;
        }
      });
      pauseButton.classList.add('pause');
      document.body.appendChild(pauseButton);
    }

    var elementsDomVisible = function elementsDomVisible(bool) {
      for(var i=0, len=document.body.children.length; i<len; i++) {
        document.body.children[i].style.display = ((bool === false) ? 'none' : 'block');
      }
    };

    var updateSceneSize = function updateSceneSize(goo) {
      var w = screenWidth * OptionsUtil.get('screenSize');
      var h = screenHeight * OptionsUtil.get('screenSize');
      goo.renderer.setSize(w, h);
    };

    var startGame = function startGame() {
      var goo = new GooRunner();
      canvas = goo.renderer.domElement;
      canvas.classList.add('canvas');
      updateSceneSize(goo);
      goo.renderer.setClearColor(0, 0, 0, 1);
      document.body.appendChild(canvas);
      
      var sun = new SunComponent(goo.world, true);

      fuelZone = new FuelZoneComponent(goo.world, true);

      //new StarshipComponent(goo.world, true);
      
      camera = new CameraComponent(
        goo.world, 
{'fraction_non_alphanumeric': 0.12257849031396126, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 2.883916990920882, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '83984', 'n_tokens_mistral': 1793, 'n_tokens_neox': 1780, 'n_words': 315}