<commit_before>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2014, <NAME>
 * http://www.melonjs.org
 *
 */

(function($) {

	/**
	 * Particle Emitter Object.
	 * @class
	 * @extends Object
	 * @memberOf me
	 * @constructor
	 * @param {me.Vector2d} pos position of the particle emitter
	 * @param {Image} image reference to the Particle Image. See {@link me.loader#getImage}
	 * @example
         *
         * // Create a basic emitter at position 100, 100
         * var emitter = new me.ParticleEmitter(100, 100, me.loader.getImage("smoke"));
         *
         * // Adjust the emitter properties
         * emitter.totalParticles = 200;
         * emitter.minLife = 1000;
         * emitter.maxLife = 3000;
         * emitter.z = 10;
         *
         * // Add the emitter to the game world
         * me.game.world.addChild(emitter);
         *
         * // Launch all particles one time and stop, like a explosion
         * emitter.burstParticles();
         *
         * // Launch constantly the particles, like a fountain
         * emitter.streamParticles();
         *
         * // At the end, remove emitter from the game world
         * // call this in onDestroyEvent function
         * me.game.world.removeChild(emitter);
         *
	 */
    me.ParticleEmitter = Object.extend(
	/** @scope me.ParticleEmitter.prototype */
	{
		// Emitter total particles
        	/** @ignore */
		_particlesCount: 0,

		// Emitter is Stream, launch particles constantly
        	/** @ignore */
		_stream: false,

		// Frequency timer (in ms) for emitter launch new particles
		// used only in stream emitter
        	/** @ignore */
		_frequencyTimer: 0,

		// Time of live (in ms) for emitter launch new particles
		// used only in stream emitter
        	/** @ignore */
		_durationTimer: 0,

		// Emitter is emitting particles
        	/** @ignore */
		_enabled: false,


		/**
		 * @ignore
		 */
		init: function(x, y, image) {
			// Emitter will always update
			this.alwaysUpdate = true;

			// Cache the emitter start pos
			this._defaultPos = new me.Vector2d(x, y);

			// Cache the emitter start image
			this._defaultImage = image;

			// Reset the emitter to defaults
			this.reset();

			/**
			 * Z-order for particles <br>
			 * default value : 0
			 * @type Number
			 * @name z
			 * @memberOf me.ParticleEmitter
			 */
			this.z = 0;
		},


		/**
		 * Reset the Emitter with defaults params <br>
		 * @function
		 * @param {Object} params [optional] object with emitter params
		 * @name reset
		 * @memberOf me.ParticleEmitter
		 */
		reset: function(params) {
			// check if params exists and create a dummy object
			params = params || {};

			/**
			 * Start position for launch particles <br>
			 * default value : x, y <br>
			 * @public
			 * @type me.Vector2d
			 * @name pos
			 * @memberOf me.ParticleEmitter
			 */
			this.pos = params.pos || this._defaultPos.clone();

			/**
			 * Variation in the start position for launch the particles (x, y) <br>
			 * Random value in range [pos - varPos, pos + varPos] <br>
			 * default value : 0, 0 <br>
			 * @public
			 * @type me.Vector2d
			 * @name varPos
			 * @memberOf me.ParticleEmitter
			 */
			this.varPos = params.varPos || new me.Vector2d(0, 0);

			/**
			 * Image used for particles <br>
			 * @public
			 * @type me.SpriteObject
			 * @name image
			 * @memberOf me.ParticleEmitter
			 */
			this.image = params.image || this._defaultImage;

			/**
			 * Total number of particles in this emitter <br>
			 * default value : 50 <br>
			 * @public
			 * @type Number
			 * @name totalParticles
			 * @memberOf me.ParticleEmitter
			 */
			this.totalParticles = params.totalParticles || 50;

			/**
			 * Minimum start angle for launch particles in Radians <br>
			 * default value : 90 <br>
			 * @public
			 * @type Number
			 * @name minAngle
			 * @memberOf me.ParticleEmitter
			 */
			this.minAngle = params.minAngle || (Math.PI / 2);

			/**
			 * Maximum start angle for launch particles in Radians <br>
			 * default value : 90 <br>
			 * @public
			 * @type Number
			 * @name maxAngle
			 * @memberOf me.ParticleEmitter
			 */
			this.maxAngle = params.maxAngle || (Math.PI / 2);

			/**<commit_msg>documentation : updated the default value<commit_after>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2014, <NAME>
 * http://www.melonjs.org
 *
 */

(function($) {

	/**
	 * Particle Emitter Object.
	 * @class
	 * @extends Object
	 * @memberOf me
	 * @constructor
	 * @param {me.Vector2d} pos position of the particle emitter
	 * @param {Image} image reference to the Particle Image. See {@link me.loader#getImage}
	 * @example
         *
         * // Create a basic emitter at position 100, 100
         * var emitter = new me.ParticleEmitter(100, 100, me.loader.getImage("smoke"));
         *
         * // Adjust the emitter properties
         * emitter.totalParticles = 200;
         * emitter.minLife = 1000;
         * emitter.maxLife = 3000;
         * emitter.z = 10;
         *
         * // Add the emitter to the game world
         * me.game.world.addChild(emitter);
         *
         * // Launch all particles one time and stop, like a explosion
         * emitter.burstParticles();
         *
         * // Launch constantly the particles, like a fountain
         * emitter.streamParticles();
         *
         * // At the end, remove emitter from the game world
         * // call this in onDestroyEvent function
         * me.game.world.removeChild(emitter);
         *
	 */
    me.ParticleEmitter = Object.extend(
	/** @scope me.ParticleEmitter.prototype */
	{
		// Emitter total particles
        	/** @ignore */
		_particlesCount: 0,

		// Emitter is Stream, launch particles constantly
        	/** @ignore */
		_stream: false,

		// Frequency timer (in ms) for emitter launch new particles
		// used only in stream emitter
        	/** @ignore */
		_frequencyTimer: 0,

		// Time of live (in ms) for emitter launch new particles
		// used only in stream emitter
        	/** @ignore */
		_durationTimer: 0,

		// Emitter is emitting particles
        	/** @ignore */
		_enabled: false,


		/**
		 * @ignore
		 */
		init: function(x, y, image) {
			// Emitter will always update
			this.alwaysUpdate = true;

			// Cache the emitter start pos
			this._defaultPos = new me.Vector2d(x, y);

			// Cache the emitter start image
			this._defaultImage = image;

			// Reset the emitter to defaults
			this.reset();

			/**
			 * Z-order for particles <br>
			 * default value : 0
			 * @type Number
			 * @name z
			 * @memberOf me.ParticleEmitter
			 */
			this.z = 0;
		},


		/**
		 * Reset the Emitter with defaults params <br>
		 * @function
		 * @param {Object} params [optional] object with emitter params
		 * @name reset
		 * @memberOf me.ParticleEmitter
		 */
		reset: function(params) {
			// check if params exists and create a dummy object
			params = params || {};

			/**
			 * Start position for launch particles <br>
			 * default value : x, y <br>
			 * @public
			 * @type me.Vector2d
			 * @name pos
			 * @memberOf me.ParticleEmitter
			 */
			this.pos = params.pos || this._defaultPos.clone();

			/**
			 * Variation in the start position for launch the particles (x, y) <br>
			 * Random value in range [pos - varPos, pos + varPos] <br>
			 * default value : 0, 0 <br>
			 * @public
			 * @type me.Vector2d
			 * @name varPos
			 * @memberOf me.ParticleEmitter
			 */
			this.varPos = params.varPos || new me.Vector2d(0, 0);

			/**
			 * Image used for particles <br>
			 * @public
			 * @type me.SpriteObject
			 * @name image
			 * @memberOf me.ParticleEmitter
			 */
			this.image = params.image || this._defaultImage;

			/**
			 * Total number of particles in this emitter <br>
			 * default value : 50 <br>
			 * @public
			 * @type Number
			 * @name totalParticles
			 * @memberOf me.ParticleEmitter
			 */
			this.totalParticles = params.totalParticles || 50;

			/**
			 * Minimum start angle for launch particles in Radians <br>
			 * default value : Math.PI / 2<br>
			 * @public
			 * @type Number
			 * @name minAngle
			 * @memberOf me.ParticleEmitter
			 */
			this.minAngle = params.minAngle || (Math.PI / 2);

			/**
			 * Maximum start angle for launch particles in Radians <br>
			 * default value : Math.PI / 2 <br>
			 * @public
			 * @type Number
			 * @name maxAngle
			 * @memberOf me.ParticleEmitter
			 */
			this.maxAngle = params.maxAngle || (Math.PI / 2);

			/**
{'fraction_non_alphanumeric': 0.12024641630138609, 'fraction_numerical': 0.013268570074635706, 'mean_word_length': 2.1417938221064383, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7025020', 'n_tokens_mistral': 3099, 'n_tokens_neox': 2437, 'n_words': 793}