<commit_before>game.GameTimerManager = Object.extend({
	init: function(x, y, settings){
		this.now = new Date().getTime();//a timer
		this.lastCreep = new Date().getTime(); //keeps track of the last time a creep happened
		this.paused = false;
		this.alwaysUpdate = true;
	},

	update: function(){
		this.now = new Date().getTime();

		this.goldTimerCheck();

		this.creepTimerCheck();

	return true; 
	},

	goldTimerCheck: function(){
		if(Math.round(this.now/1000)%20 ===0 && (this.now - this.lastCreep >= 1000)){
			console.log( "Gold" + game.data.gold);
			game.data.gold += 1;
		}
	},

	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){ //if the player is dead
			me.game.world.removeChild(game.data.player); //removes the player
			me.state.current().resetPlayer(10, 0); //resets him
		}
		return true
	}
});

game.ExperienceManager = object.extend({
	init: function(x, y, settings){
		this.alwaysUpdate = true; //always update the function
	}
	update: function(){
		if(game.data.win === true){ //if win=true add 10 exp
			game.data.exp += 10;
		}else if(game.data.win === false){ //if win=false add 3 exp
			game.data.exp += 3;
		}
		return true;
	}
});<commit_msg>video 37, check and fix ExperienceManager, CODED (no need for comments) *added gameOver variable<commit_after>game.GameTimerManager = Object.extend({
	init: function(x, y, settings){
		this.now = new Date().getTime();//a timer
		this.lastCreep = new Date().getTime(); //keeps track of the last time a creep happened
		this.paused = false;
		this.alwaysUpdate = true;
	},

	update: function(){
		this.now = new Date().getTime();

		this.goldTimerCheck();

		this.creepTimerCheck();

	return true; 
	},

	goldTimerCheck: function(){
		if(Math.round(this.now/1000)%20 ===0 && (this.now - this.lastCreep >= 1000)){
			console.log( "Gold" + game.data.gold);
			game.data.gold += 1;
		}
	},

	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){ //if the player is dead
			me.game.world.removeChild(game.data.player); //removes the player
			me.state.current().resetPlayer(10, 0); //resets him
		}
		return true
	}
});

game.ExperienceManager = object.extend({
	init: function(x, y, settings){
		this.alwaysUpdate = true; //always update the function
		this.gameOver = false;
	}
	update: function(){
		if(game.data.win === true && !this.gameOver){ //if win=true add 10 exp
			game.data.exp += 10;
			this.gameOver = true;
		}else if(game.data.win === false && !this.gameOver){ //if win=false add 3 exp
			game.data.exp += 3;
			this.gameOver = true;
		}
		console.log(game.data.exp);

		return true;
	}
});
{'fraction_non_alphanumeric': 0.17609293793946806, 'fraction_numerical': 0.023845918679302965, 'mean_word_length': 3.576223776223776, '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': '3798023', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1161, 'n_words': 270}