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

📄 rect.java

📁 Position.java :辅助类 SerpentGameCanvas.java :游戏主控类 Maze.java :迷宫 SerpentGame.java :应用主控类 Serpent.java
💻 JAVA
字号:
public class Rect extends Object
{
	public int left;
	public int top;
	public int width;
	public int height;
	
	public Rect(Position pos)
	{
		left=pos.x *6;
		top=pos.y *6;
		width=6;
		height=6;
	}
	
	public Rect(Position pos, int ratio)
	{
		left=pos.x * ratio;
		top=pos.y * ratio;
		width=ratio;
		height=ratio;
	}
	
	public void merge(Rect rt)
	{
		int l, t, r, b;
		l=Math.min(left, rt.left);
		t=Math.min(top, rt.top);
		r=Math.max(left+width, rt.left+rt.width);
		b=Math.max(top+height, rt.top+rt.height);
		left=l;
		top=t;
		width=r-l;
		height=b-t;
	}
	
}

⌨️ 快捷键说明

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