ding.java

来自「俄罗斯方块游戏」· Java 代码 · 共 58 行

JAVA
58
字号
import java.awt.*;
public class Ding extends SquareShape {
	
	private Color dingColor=new Color(255,0,0);
	public Ding() {
		this.color=dingColor;
		// TODO Auto-generated constructor stub
	}

	public void defaultRotate() {
		// TODO Auto-generated method stub
		postion[0][0]=xpos;
		postion[0][1]=ypos;
		for(int i=1;i<4;i++)
		{
			postion[i][0]=xpos+(i-2)*20;
			postion[i][1]=ypos+20;
		}

	}

	public void firstRotate() {
		// TODO Auto-generated method stub
		for(int i=0;i<3;i++)
		{
			postion[i][0]=xpos;
			postion[i][1]=ypos+i*20;
		}
		postion[3][0]=xpos+20;
		postion[3][1]=ypos+20;

	}

	public void secondRotate() {
		// TODO Auto-generated method stub
		for(int i=0;i<3;i++)
		{
			postion[i][0]=xpos+(i-1)*20;
			postion[i][1]=ypos;
		}
		postion[3][0]=xpos;
		postion[3][1]=ypos+20;
	}

	public void thirdRotate() {
		// TODO Auto-generated method stub
		for(int i=0;i<3;i++)
		{
			postion[i][0]=xpos;
			postion[i][1]=ypos+i*20;
		}
		postion[3][0]=xpos-20;
		postion[3][1]=ypos+20;

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?