<commit_before>const CHAR_ANIM_RATE = 6;
const SHADOW_RATE = 36;
const WALL_RATE = 15;

function Stage (renderer, maze) {
	PIXI.Container.call(this);
	this.renderer = renderer;
	this.maze = maze;
	this.wallsRendered = [];
	this.radius = 300;

	this.character = Assets.textures.character[0];
	this.character = new PIXI.Sprite(this.character, this.character.width, this.character.height);
	this.character.x = this.renderer.width/2;
	this.character.y = this.renderer.height/2;
	this.character.anchor.x = 0.5;
	this.character.anchor.y = 0.5;
	this.character.frame = 0;

	this.foutain = Assets.textures.fountain1;
	console.log(this.foutain);
	this.foutain = new PIXI.Sprite(this.foutain, this.foutain.width, this.foutain.height);
	var tile = this.maze.freeTiles[0];
	console.log(tile);
	//this.foutain.position.x = tile.col * Assets.tileSize;
	//this.foutain.position.y = tile.line * Assets.tileSize;

	this.floorRendered = [];
	this.frame = CHAR_ANIM_RATE;

	this.blackFog = new PIXI.Graphics();
	this.blackFog.lineStyle ( 2 , 0x000000,  1);
	this.blackFog.beginFill(this.colour);
	this.blackFog.drawCircle(renderer.width / 2, renderer.height / 2, this.radius);

	var canvas = document.createElement('canvas');
	canvas.width = this.renderer.width;
	canvas.height = this.renderer.height;
	var ctx = canvas.getContext('2d');
	var gradient = ctx.createLinearGradient(0,0,170,0);
	gradient.addColorStop(0,"black");
	gradient.addColorStop(1,"white");

	ctx.fillStyle = gradient;
	ctx.fillRect(20,20,150,100);

	var texture = PIXI.Texture.fromCanvas(canvas);
	// blackFog.filters = [new PIXI.AlphaMaskFilter(texture)];

	this.blackFog.position.x = renderer.width / 2;
	this.blackFog.position.y = renderer.height / 2;
	// this.addChild(blackFog);
	this.mask = this.blackFog;
	this.mask.frame = SHADOW_RATE;


	var that = this;

	var generate = function () {
		for (var line=0 ; line<maze.height ; line++) {
			that.floorRendered[line] = [];
			for (var col=0 ; col<maze.width ; col++) {
				var floor = Assets.textures.floor;
				floor = new PIXI.Sprite(floor, floor.width, floor.height);
				that.floorRendered[line][col] = floor;
				that.addChildAt(floor, line*this.maze.width + col);
			}
		}

		that.addChildAt(that.character, that.children.length);

		for (var line=0 ; line<maze.height ; line++) {
			that.wallsRendered[line] = [];
			for (var col=0 ; col<maze.width ; col++) {
				if (maze.walls[line][col]){
					var sprite = that.selectSprite (line, col, Assets.textures.wallsAnim);
					that.wallsRendered[line][col] = sprite;
					that.addChildAt(sprite, that.children.length);
				} else {
					that.wallsRendered[line][col] = null;
				}
			}
		}
	}

	var trigger = function() {
		if (that.maze.loaded)
			generate();<commit_msg>musique<commit_after>const CHAR_ANIM_RATE = 6;
const SHADOW_RATE = 36;
const WALL_RATE = 15;

function Stage (renderer, maze) {
	PIXI.Container.call(this);
	this.renderer = renderer;
	this.maze = maze;
	this.wallsRendered = [];
	this.radius = 300;

	this.audio = document.querySelector('#audioPlayer');

	this.character = Assets.textures.character[0];
	this.character = new PIXI.Sprite(this.character, this.character.width, this.character.height);
	this.character.x = this.renderer.width/2;
	this.character.y = this.renderer.height/2;
	this.character.anchor.x = 0.5;
	this.character.anchor.y = 0.5;
	this.character.frame = 0;

	this.foutain = Assets.textures.fountain1;
	console.log(this.foutain);
	this.foutain = new PIXI.Sprite(this.foutain, this.foutain.width, this.foutain.height);
	var tile = this.maze.freeTiles[0];
	console.log(tile);
	//this.foutain.position.x = tile.col * Assets.tileSize;
	//this.foutain.position.y = tile.line * Assets.tileSize;

	this.floorRendered = [];
	this.frame = CHAR_ANIM_RATE;

	this.blackFog = new PIXI.Graphics();
	this.blackFog.lineStyle ( 2 , 0x000000,  1);
	this.blackFog.beginFill(this.colour);
	this.blackFog.drawCircle(renderer.width / 2, renderer.height / 2, this.radius);

	var canvas = document.createElement('canvas');
	canvas.width = this.renderer.width;
	canvas.height = this.renderer.height;
	var ctx = canvas.getContext('2d');
	var gradient = ctx.createLinearGradient(0,0,170,0);
	gradient.addColorStop(0,"black");
	gradient.addColorStop(1,"white");

	ctx.fillStyle = gradient;
	ctx.fillRect(20,20,150,100);

	var texture = PIXI.Texture.fromCanvas(canvas);
	// blackFog.filters = [new PIXI.AlphaMaskFilter(texture)];

	this.blackFog.position.x = renderer.width / 2;
	this.blackFog.position.y = renderer.height / 2;
	// this.addChild(blackFog);
	this.mask = this.blackFog;
	this.mask.frame = SHADOW_RATE;


	var that = this;

	var generate = function () {
		for (var line=0 ; line<maze.height ; line++) {
			that.floorRendered[line] = [];
			for (var col=0 ; col<maze.width ; col++) {
				var floor = Assets.textures.floor;
				floor = new PIXI.Sprite(floor, floor.width, floor.height);
				that.floorRendered[line][col] = floor;
				that.addChildAt(floor, line*this.maze.width + col);
			}
		}

		that.addChildAt(that.character, that.children.length);

		for (var line=0 ; line<maze.height ; line++) {
			that.wallsRendered[line] = [];
			for (var col=0 ; col<maze.width ; col++) {
				if (maze.walls[line][col]){
					var sprite = that.selectSprite (line, col, Assets.textures.wallsAnim);
					that.wallsRendered[line][col] = sprite;
					that.addChildAt(sprite, that.children.length);
				} else {
					that.wallsRendered[line][col] = null;
				}
			}
		}

		that.audio.play();
	}

	var trigger = function() {
		if (that.maze.loaded)
			generate();
{'fraction_non_alphanumeric': 0.15718157181571815, 'fraction_numerical': 0.01951219512195122, 'mean_word_length': 4.032727272727273, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7096617', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2059, 'n_words': 344}