All pastes #445886 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-18 04:17 UTC
rendered paste body
	public void checkDrops()
	{
		boolean changed = false;
		
		for (int x=0; x < blocks.length; x++) // X axis
		{
			for (int y=blocks[0].length-1; y > 0 ; y--) // Y axis
			{
				Block b1 = blocks[x][y];
				Color c1 = b1.getColor();
				Block b2 = blocks[x][y-1];
				Color c2 = b2.getColor();
				if (c1.equals(Color.BLACK))
				{
					if (!c1.equals(c2))
						changed = true;
					
					b1.setColor(c2);
					b2.setColor(c1);
				}
			}
		}
		
		if (changed)
			checkCombos();
	}