⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 table.java

📁 Java 开发的俄罗斯方块游戏
💻 JAVA
字号:

public class Table {
	private static int x = 20;//游戏数组的高;
	private static int y = 15;//游戏数组的宽
	public static int[][] mytable = new int[x][y];//游戏桌对应的游戏数组,这个数组很重要的
	public Table(){
		this.x = 20;
		this.y = 15;
	}
	
	public static int getX() {
		return x;
	}
	public static void setX(int x) {
		Table.x = x;
	}
	public static int getY() {
		return y;
	}
	public static void setY(int y) {
		Table.y = y;
	}
	//打印出游戏数组的值的情况,本方法是用来进行测试用的,测试已经通过了,可以删去了
	public static void showTable(){
		for(int i = 0 ; i < x ; i ++){
			for(int j = 0; j <y ; j ++){
				System.out.print(mytable[i][j]);
			}
			System.out.println("第"+i+"行");
		}
	}
	//游戏数组初时化
	public static void init (){
		for(int i = 0; i < x ; i ++){
			for(int j = 0 ; j < y ; j ++){
				mytable[i][j] = 0 ;
			}
		}
	}
}

⌨️ 快捷键说明

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