<commit_before>game.GameTimerManager = Object.extend({
    init: function(x, y, settings) {
        this.now = new Date().getTime();
        this.lastCreep = new Date().getTime();
        this.paused = false;
        this.alwaysUpdate = true;
    },
    update: function() {
        this.now = new Date().getTime();       
        this.goldTimer();
        this.creepTimerCheck();


        return true;
    },
     
    goldTimerCheck: function(){
        if (Math.round(this.now / 1000) %20 === 0 && (this.now - this.lastCreep >= 1000)) {
            game.data.gold += 1;
            console.log("Current gold: " + game.data.gold);
        }
    }, 
    
    creepTimerCheck: function(){
       if (Math.round(this.now / 1000) % 10 === 0 && (this.now - this.lastCreep >= 1000)) {
            this.lastCreep = this.now;
            var creepe = me.pool.pull("EnemyCreep", 1000, 0, {});
            me.game.world.addChild(creepe, 5);

        } 
    }
});

game.HeroDeathManager = Object.extend({
    init: function(x, y, settings){
        this.alwaysUpdate = true;
    },
    
    update: function(){
      if(game.data.player.dead){
            console.log("dead");
            me.game.world.removeChild(game.data.player);
            me.state.current().resetPlayer(10, 0);
        }  
        
        return true;
    }
});

game.ExperienceManager = Object.extend({
    init: function(x, y, settings){
      this.always = true;
    },
    
    update: function(){
        if(game.data.win === true){
            game.data.exp += 10;
        }else if(game.data.win === false){
            game.data.exp += 1;
        }
        
        return true;
    }
    
});
<commit_msg>finished video 37<commit_after>game.GameTimerManager = Object.extend({
    init: function(x, y, settings) {
        this.now = new Date().getTime();
        this.lastCreep = new Date().getTime();
        this.paused = false;
        this.alwaysUpdate = true;
    },
    update: function() {
        this.now = new Date().getTime();       
        this.goldTimer();
        this.creepTimerCheck();


        return true;
    },
     
    goldTimerCheck: function(){
        if (Math.round(this.now / 1000) %20 === 0 && (this.now - this.lastCreep >= 1000)) {
            game.data.gold += 1;
            console.log("Current gold: " + game.data.gold);
        }
    }, 
    
    creepTimerCheck: function(){
       if (Math.round(this.now / 1000) % 10 === 0 && (this.now - this.lastCreep >= 1000)) {
            this.lastCreep = this.now;
            var creepe = me.pool.pull("EnemyCreep", 1000, 0, {});
            me.game.world.addChild(creepe, 5);

        } 
    }
});

game.HeroDeathManager = Object.extend({
    init: function(x, y, settings){
        this.alwaysUpdate = true;
    },
    
    update: function(){
      if(game.data.player.dead){
            console.log("dead");
            me.game.world.removeChild(game.data.player);
            me.state.current().resetPlayer(10, 0);
        }  
        
        return true;
    }
});

game.ExperienceManager = Object.extend({
    init: function(x, y, settings){
      this.always = true;
      this.gameOver = false;
    },
    
    update: function(){
        if(game.data.win === true){
            game.data.exp += 10;
            this.gameOver = true;
        }else if(game.data.win === false){
            game.data.exp += 1;
        }
        console.log(game.data.exp);
        
        return true;
    }
    
});

{'fraction_non_alphanumeric': 0.1570892289922033, 'fraction_numerical': 0.020791221484262202, 'mean_word_length': 1.7211311861743912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3277736', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1078, 'n_words': 201}