<commit_before>
var Wind = function (game) {
    this.game = game;
    this.create();
};

//Snow.prototype = Object.create(Phaser.Sprite.prototype);
Wind.prototype.constructor = Wind;


Wind.prototype.create = function(){
    this.windIsAvailable = false;
    this.windForce = 0;

    this.windTimer = this.game.time.create(false);
    this.windTimer.start();
    this.windTimer.add(Math.random() * (4000 - 2000)+2000, this.changeWind, this);
};


Wind.prototype.changeWind = function(){
    if(this.windForce) {
        this.windForce = 0;
    }else{
        this.windForce = 200;
    }
    this.windTimer.add(Math.random() * (4000 - 2000)+2000, this.changeWind, this);
};

Wind.prototype.update = function(snow, entities){

        if(snow !== undefined) snow.changeWindDirection(this.windForce);

    if(this.windForce){
        entities.forEachAlive(function(sprite){
            sprite.body.x+=1;
        });
    }

};


<commit_msg>Ameliored the wind<commit_after>
var Wind = function (game) {
    this.game = game;
    this.create();
};

//Snow.prototype = Object.create(Phaser.Sprite.prototype);
Wind.prototype.constructor = Wind;


Wind.prototype.create = function(){
    this.windChanged = false;
    this.windForce = 0;

    this.windTimer = this.game.time.create(false);
    this.windTimer.start();
    this.windTimer.add(Math.random() * (4000 - 2000)+2000, this.changeWind, this);
};


Wind.prototype.changeWind = function(){
    if(this.windForce) {
        this.windForce = 0;
    }else{
        this.windForce = Math.random() > 0.5 ? -200 : 200;
    }
    this.windChanged = true;
    this.windTimer.add(Math.random() * (4000 - 3000)+3000, this.changeWind, this);
};

Wind.prototype.update = function(snow, entities){

    if(snow !== undefined && this.windChanged){
        snow.changeWindDirection(this.windForce);
        this.windChanged = false;
    }

    if(this.windForce != 0){
        var force = this.windForce;
        entities.forEachAlive(function(sprite){
            //console.log(this.windForce);
            sprite.body.x+=(force/100);
        });
    }

};



{'fraction_non_alphanumeric': 0.15663801337153774, 'fraction_numerical': 0.03247373447946514, 'mean_word_length': 2.858195211786372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1839818', 'n_tokens_mistral': 759, 'n_tokens_neox': 676, 'n_words': 111}