<commit_before>
 game.PlayerEntity = me.Entity.extend({

     init:function (x, y, settings) {
        // call the constructor
        this._super(me.Entity, 'init', [x, y , settings]);

        // set the default horizontal & vertical speed (accel vector)
        this.body.setVelocity(3, 15);

        // ensure the player is updated even when outside of the viewport
        this.alwaysUpdate = true;
        this.arithmetic = [];

        this.arithmetic.isFirstNumber = true;
        this.arithmetic.isSecondNumber = false;
        this.arithmetic.isThirdNumber = false;
        this.arithmetic.order = "first";
        this.pos.mouse = -1;

        // define a basic walking animation (using all frames)
        // this.renderable.addAnimation("walk",  [0, 1, 2, 3, 4, 5, 6, 7]);
        // define a standing animation (using the first frame)
        this.renderable.addAnimation("stand",  [0]);
        // set the standing animation as default
        this.renderable.setCurrentAnimation("stand");
    },

     update : function (dt) {
        if (me.input.isKeyPressed('left')) {
          this.renderable.flipX(true);
          // update the entity velocity
          this.body.vel.x -= this.body.accel.x * me.timer.tick;
          // change to the walking animation
          // if (!this.renderable.isCurrentAnimation("walk")) {
          //   this.renderable.setCurrentAnimation("walk");
          // }
        } else if (me.input.isKeyPressed('right')) {
            this.renderable.flipX(false);
            // update the entity velocity
            this.body.vel.x += this.body.accel.x * me.timer.tick;
            // change to the walking animation
            // if (!this.renderable.isCurrentAnimation("walk")) {
            //   this.renderable.setCurrentAnimation("walk");
            // }
        } else if (me.input.isKeyPressed('click')) {
          this.pos.mouse = Math.round(me.input.mouse.pos.x, 0);
          if ((this.pos.mouse - this.pos.x) > 0) {
              this.renderable.flipX(false);
              this.body.vel.x += this.body.accel.x * me.timer.tick;
          } else {
              this.renderable.flipX(true);
              this.body.vel.x -= this.body.accel.x * me.timer.tick;
          }
        } else if ((this.pos.mouse - this.pos.x) > -2 && 2 > (this.pos.mouse - this.pos.x)) {
              this.body.vel.x = 0;
              this.pos.mouse = -1;
        } else if (this.pos.mouse == -1) {
            this.body.vel.x = 0;
        }

        this.body.update(dt);

        me.collision.check(this);

        // return true if we moved or if the renderable was updated
        return (this._super(me.Entity, 'update', [dt]) || this.body.vel.x !== 0 || this.body.vel.y !== 0 || me.input.mouse.pos.x != this.pos.x);
    },

     onCollision : function (response, other) {
        return true;
    }
});

game.HiveEntity = me.CollectableEntity.extend({
  init: function(x, y, settings) {
    this._super(me.CollectableEntity, 'init', [x, y , settings]);

    this.renderable.addAnimation("spin",  [0, 1, 2, 3, 4, 5, 6, 7]);
    this.renderable.setCurrentAnimation("spin");
    this.body.setVelocity(1, 1);
    this.alwaysUpdate = true;
    this.arithmetic = [];
    this.arithmetic.value = (1).random(11);
    this.font = new me.BitmapFont("32x32_font", 32);
},

update : function (dt) {
    this.body.vel.y += this.body.accel.y * me.timer.tick;
    if (this.pos.y > 450) {
      this.pos.y = this.hiveRestartPositionY();
      this.arithmetic.value = this.getArithmeticValue(game.data.arithmetic.order, game.data.arithmetic.expectedResult);
  }
  this.body.update(dt);
  return this._super(me.Entity, 'update', [dt]);
},

draw: function (renderer) {
    this.font.draw(renderer, this.arithmetic.value, this.pos.x+32, this.pos.y+20);
    this._super(me.Entity, 'draw', [renderer]);
},

onCollision : function (response, other) {
    this.pos.y = this.hiveRestartPositionY();

    switch(game.data.arithmetic.order) {
        case "first":
            game.data.arithmetic.firstNumber = this.arithmetic.value;
            game.data.arithmetic.score = game.data.arithmetic.firstNumber;
            game.data.arithmetic.order = "operation";
        break;
        case "operation":
            if (this.arithmetic.value == "+" || this.arithmetic.value == "-") {
                game.data.arithmetic.operation = this.arithmetic.value;
                game.data.arithmetic.score += game.data.arithmetic.operation;
                game.data.arithmetic.order = "second";
            }
        break;
        case "second":<commit_msg>get rid of constant value<commit_after>
 game.PlayerEntity = me.Entity.extend({

     init:function (x, y, settings) {
        // call the constructor
        this._super(me.Entity, 'init', [x, y , settings]);

        // set the default horizontal & vertical speed (accel vector)
        this.body.setVelocity(3, 15);

        // ensure the player is updated even when outside of the viewport
        this.alwaysUpdate = true;
        this.arithmetic = [];

        this.arithmetic.isFirstNumber = true;
        this.arithmetic.isSecondNumber = false;
        this.arithmetic.isThirdNumber = false;
        this.arithmetic.order = "first";
        this.pos.mouse = -1;

        // define a basic walking animation (using all frames)
        // this.renderable.addAnimation("walk",  [0, 1, 2, 3, 4, 5, 6, 7]);
        // define a standing animation (using the first frame)
        this.renderable.addAnimation("stand",  [0]);
        // set the standing animation as default
        this.renderable.setCurrentAnimation("stand");
    },

     update : function (dt) {
        if (me.input.isKeyPressed('left')) {
          this.renderable.flipX(true);
          // update the entity velocity
          this.body.vel.x -= this.body.accel.x * me.timer.tick;
          // change to the walking animation
          // if (!this.renderable.isCurrentAnimation("walk")) {
          //   this.renderable.setCurrentAnimation("walk");
          // }
        } else if (me.input.isKeyPressed('right')) {
            this.renderable.flipX(false);
            // update the entity velocity
            this.body.vel.x += this.body.accel.x * me.timer.tick;
            // change to the walking animation
            // if (!this.renderable.isCurrentAnimation("walk")) {
            //   this.renderable.setCurrentAnimation("walk");
            // }
        } else if (me.input.isKeyPressed('click')) {
          this.pos.mouse = Math.round(me.input.mouse.pos.x, 0);
          if ((this.pos.mouse - this.pos.x) > 0) {
              this.renderable.flipX(false);
              this.body.vel.x += this.body.accel.x * me.timer.tick;
          } else {
              this.renderable.flipX(true);
              this.body.vel.x -= this.body.accel.x * me.timer.tick;
          }
        } else if ((this.pos.mouse - this.pos.x) > -2 && 2 > (this.pos.mouse - this.pos.x)) {
              this.body.vel.x = 0;
              this.pos.mouse = -1;
        } else if (this.pos.mouse == -1) {
            this.body.vel.x = 0;
        }

        this.body.update(dt);

        me.collision.check(this);

        // return true if we moved or if the renderable was updated
        return (this._super(me.Entity, 'update', [dt]) || this.body.vel.x !== 0 || this.body.vel.y !== 0 || me.input.mouse.pos.x != this.pos.x);
    },

     onCollision : function (response, other) {
        return true;
    }
});

game.HiveEntity = me.CollectableEntity.extend({
  init: function(x, y, settings) {
    this._super(me.CollectableEntity, 'init', [x, y , settings]);

    this.renderable.addAnimation("spin",  [0, 1, 2, 3, 4, 5, 6, 7]);
    this.renderable.setCurrentAnimation("spin");
    this.body.setVelocity(1, 1);
    this.alwaysUpdate = true;
    this.arithmetic = [];
    this.arithmetic.value = (1).random(11);
    this.font = new me.BitmapFont("32x32_font", 32);
},

update : function (dt) {
  this.body.vel.y += this.body.accel.y * me.timer.tick;
  if (this.pos.y > me.game.world.height) {
      this.pos.y = this.hiveRestartPositionY();
      this.arithmetic.value = this.getArithmeticValue(game.data.arithmetic.order, game.data.arithmetic.expectedResult);
  }
  this.body.update(dt);
  return this._super(me.Entity, 'update', [dt]);
},

draw: function (renderer) {
    this.font.draw(renderer, this.arithmetic.value, this.pos.x+32, this.pos.y+20);
    this._super(me.Entity, 'draw', [renderer]);
},

onCollision : function (response, other) {
    this.pos.y = this.hiveRestartPositionY();

    switch(game.data.arithmetic.order) {
        case "first":
            game.data.arithmetic.firstNumber = this.arithmetic.value;
            game.data.arithmetic.score = game.data.arithmetic.firstNumber;
            game.data.arithmetic.order = "operation";
        break;
        case "operation":
            if (this.arithmetic.value == "+" || this.arithmetic.value == "-") {
                game.data.arithmetic.operation = this.arithmetic.value;
                game.data.arithmetic.score += game.data.arithmetic.operation;
                game.data.arithmetic.order = "second";
            }
        break;
        case "second":
{'fraction_non_alphanumeric': 0.1503980804886029, 'fraction_numerical': 0.010360999018431672, 'mean_word_length': 2.1361149110807114, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 11, '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': '2451009', 'n_tokens_mistral': 2936, 'n_tokens_neox': 2834, 'n_words': 563}