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

📄 createblock.txt

📁 随机生成彩色小圆点
💻 TXT
字号:
import java.util.Random;
import java.util.TimerTask;


public class CreateBlock extends TimerTask{
	Random r1,r2,r3,r4;
	TimerCanvas tc;
	public CreateBlock(TimerCanvas t){
		r1=new Random();
		r2=new Random();
		r3=new Random();
		r4=new Random();
		tc=t;
	}
  public void run(){
	  Block b=new Block();
	  b.x=Math.abs(r1.nextInt())%tc.getWidth();
	  b.y=Math.abs(r2.nextInt())%tc.getHeight();
	  b.w=Math.abs(r3.nextInt())%15;
	  b.h=Math.abs(r4.nextInt())%10;
	  tc.addBlock(b);
	  //
	  tc.repaint();
  }
}


⌨️ 快捷键说明

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