//Copyright (C) Ben Parbury - All Rights Reserved. Unauthorized copying of this file, via any medium is strictly prohibited. Written by Ben Parbury <ben@gridlockinteractive.com> 2014

function UndoParticle(data)
{
	this.offset = data.offset;
	
	this.Update = function()
	{
		return false;
	}

	this.Draw = function()
	{
		gDraw.foreparticles.beginPath();
		gDraw.foreparticles.strokeStyle = "rgba(255, 255, 255, 0.5)"
		gDraw.foreparticles.lineWidth = 1;
		var y = (this.offset + gLevelSystem.time) % gDraw.canvas.height;
		y -= gDraw.verticalCenterOffset;
		
		for(var i = 1; i < 11; i++)
		{
			for(var j = 0; j < (11 - i); j++)
			{
				var x = -10 - gDraw.horizontalCenterOffset;
				while(x <= gDraw.canvas.width)
				{
					x += Math.randomRange(2, 50);
					gDraw.foreparticles.moveTo(x, y - (i * 2));
					x += Math.randomRange(2, 10);
					gDraw.foreparticles.lineTo(x, y - (i * 2));
				}
			}
		}
		
		gDraw.foreparticles.stroke();
	}
}

gParticleSystem.Register("UndoParticle", UndoParticle);
