deep.js
// This function chooses a random shape, equivalent to spawn probability.

This function chooses a random shape, equivalent to spawn probability.
This function chooses a random shape equivalent to spawn probability .
function rshape()
{
	if (Math.random() * 100 < 50)
	{
		return S_SQUARE;
	}
	else if (Math.random() * 100 < 75)
	{
		return S_TRIANGLE;
	}
	else if (Math.random() * 100 < 70)
	{
		return S_PENTAGON;
	}
	else if (Math.random() * 100 < 10)
	{
		return S_ALPHA;
	}
	else if (Math.random() * 100 < 10)
	{
		return Math.floor(Math.random() * 4) + S_GREEN_SQUARE;
	}
	else
	{
		return S_SQUARE;
	}
}
function rshape ( ) { if ( Math . random ( ) * 100 < 50 ) { return S_SQUARE ; } else if ( Math . random ( ) * 100 < 75 ) { return S_TRIANGLE ; } else if ( Math . random ( ) * 100 < 70 ) { return S_PENTAGON ; } else if ( Math . random ( ) * 100 < 10 ) { return S_ALPHA ; } else if ( Math . random ( ) * 100 < 10 ) { return Math . floor ( Math . random ( ) * 4 ) + S_GREEN_SQUARE ; } else { return S_SQUARE ; } }
This function chooses a random shape, equivalent to spawn probability.
This function chooses a random shape equivalent to spawn probability .