
var flames = new Array(30);
var flamecount = 0;
var max_flames = 0;

for (i=0;i<max_flames+1;i++)
{
	flames[i] = new Object();
	flames[i].x = -1;
	flames[i].y = -1;
	flames[i].id = -1;
	flames[i].frame = -1;
	flames[i].active = false;
}



function IgniteFlame(x,y)
{
	if (math.abs(flames[flamecount].x - x)>32)
	{
		flamecount++;
		flames[flamecount] = new Object();
		flames[flamecount].x = x;
		flames[flamecount].y = y;
		CreatePerson("flame"+flamecount, "flame.rss", true);
		flames[flamecount].id = GetPersonId("flame"+flamecount);
		SetPersonIDX(flames[flamecount].id, x);
		SetPersonIDY(flames[flamecount].id, y);
		SetPersonIDLayer(flames[flamecount].id, blood_layer);
		flames[flamecount].id = -1;
		flames[flamecount].frame = 0;
		flames[flamecount].active = false;	
	}
}

function UpdateFlames()
{
	if (g_frames%frameupdate == 0)
	{
		for (uf=0;uf<flamecount;uf++)
		{
			//update flames here
		}
	}
}