dist/tetris.js
/**
	Create  a random shape for game
*/
Create  a random shape for game
Create a random shape for game
function randomShape()
{
	var result = Math.floor( Math.random() * 7 );
	var shape;
	switch(result)
	{
		case 0: shape = new ShapeL();			break;
		case 1: shape = new ShapeO();			break;
		case 2: shape = new ShapeZ();			break;
		case 3: shape = new ShapeT();			break;
		case 4: shape = new ShapeLR();			break;
		case 5: shape = new ShapeZR();			break;
		case 6: shape = new ShapeI();			break;
	}
	shape.init();
	return shape;
}
function randomShape ( ) { var result = Math . floor ( Math . random ( ) * 7 ) ; var shape ; switch ( result ) { case 0 : shape = new ShapeL ( ) ; break ; case 1 : shape = new ShapeO ( ) ; break ; case 2 : shape = new ShapeZ ( ) ; break ; case 3 : shape = new ShapeT ( ) ; break ; case 4 : shape = new ShapeLR ( ) ; break ; case 5 : shape = new ShapeZR ( ) ; break ; case 6 : shape = new ShapeI ( ) ; break ; } shape . init ( ) ; return shape ; }
Create  a random shape for game
Create a random shape for game