进一步完善实现俄罗斯方块的左移,右移,下移和旋转
1,实现方块的旋转;
2,实现方块是否可以移动的判定;
3,实现方块是否可以旋转的判定;
4,随机生成方块;
涉及的类:
1,BlockListener
2,CController
3,CBlock
4,CGlobal
一、BlockListener类:public boolean moveTo(PointnewPos) 改成public void moveTo(Point newPos,int direction);
public interface BlockListener
{
public void erase(CShowPanel panel,Point pos);
public void moveTo(Point newPos,int direction);
}
二、CController类:
/**
*作 者: Helloway
*类 名:CController
*类说明:
*/
public class CController extends KeyAdapter implements GameListener,BlockListener
{
private BlockFactory factory;
pr