<commit_before>Pinky = function (game, player, type) {

    var x = game.world.randomX;
    var y = game.world.randomY;


    this.badboy = type == "badboy" ? true : false;
    var color = this.badboy ? "pinky" : "greeny";
    this.game = game;
    this.player = player;
    this.velocity = _.random(0, 100);
    this.alive = true;
    this.type = type
    this.pinky = game.add.sprite(x, y, color);

    this.game.physics.arcade.enable(this.pinky);

    this.pinky.body.bounce.y = 1;
    this.pinky.body.gravity.y = 900;
    this.pinky.body.bounce.x = 1;
    this.pinky.body.collideWorldBounds = true;

    this.pinky.animations.add('left', [0, 1], 5, true);
    this.pinky.animations.add('right', [2,3], 5, true);
    this.pinky.body.velocity.x = 0;
};

Pinky.prototype.move_left = function(){
  this.pinky.body.velocity.x = -this.velocity;

  this.pinky.animations.play('left');
}

Pinky.prototype.move_right = function(){
  this.pinky.body.velocity.x = this.velocity;

  this.pinky.animations.play('right');
}

Pinky.prototype.update = function() {
    if (this.pinky.x < this.player.x){
        this.move_right();
    }else{
        this.move_left();
    }
    if (this.pinky.body.touching.down)
    {
        this.pinky.body.velocity.y = -600;
    }
};
<commit_msg>Fix pinkies in order to not create them stucked in the platforms<commit_after>Pinky = function (game, player, type) {

    var x = game.world.randomX;
    var y = _.random(1, 500);


    this.badboy = type == "badboy" ? true : false;
    var color = this.badboy ? "pinky" : "greeny";
    this.game = game;
    this.player = player;
    this.velocity = _.random(0, 100);
    this.alive = true;
    this.type = type;
    this.pinky = game.add.sprite(x, y, color);

    this.game.physics.arcade.enable(this.pinky);

    this.pinky.body.bounce.y = 1;
    this.pinky.body.gravity.y = 900;
    this.pinky.body.bounce.x = 1;
    this.pinky.body.collideWorldBounds = true;

    this.pinky.animations.add('left', [0, 1], 5, true);
    this.pinky.animations.add('right', [2,3], 5, true);
    this.pinky.body.velocity.x = 0;
};

Pinky.prototype.move_left = function(){
  this.pinky.body.velocity.x = -this.velocity;

  this.pinky.animations.play('left');
}

Pinky.prototype.move_right = function(){
  this.pinky.body.velocity.x = this.velocity;

  this.pinky.animations.play('right');
}

Pinky.prototype.update = function() {
    if (this.pinky.x < this.player.x){
        this.move_right();
    }else{
        this.move_left();
    }
    if (this.pinky.body.touching.down)
    {
        this.pinky.body.velocity.y = -600;
    }
};

{'fraction_non_alphanumeric': 0.16782407407407407, 'fraction_numerical': 0.016203703703703703, 'mean_word_length': 2.7798833819241984, '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': '6044112', 'n_tokens_mistral': 1076, 'n_tokens_neox': 972, 'n_words': 168}