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

📄 block.java

📁 简单的贪吃蛇源码
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.KeyEvent;


public class Block {
	public static final int BLOCKWH = 20;
	int x ,y ;	
	private Color c;
	
	public Block(int x,int y,Color c){
		this.x = x;
		this.y = y;
		this.c = c;		
	}
	
	public void Draw(Graphics g){
		Color tmpc = g.getColor();
		g.setColor(c);
		g.fillRect(x, y, BLOCKWH, BLOCKWH);		
		g.setColor(tmpc);		
	}
	
	public Rectangle getRect() {
		return new Rectangle(x, y, BLOCKWH , BLOCKWH);
	}

	public Color getC() {
		return c;
	}
	
}

⌨️ 快捷键说明

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