📄 boxesgame2.java
字号:
package net.java.gamebase.sample.boxes.v2;
import java.util.Random;
import net.java.gamebase.core.GameBaseUI;
/**
* ramdomize the color of the box generating the limit of the color
* by the size of list of colors
*
* @author hlima
*
*/
public class BoxesGame2 extends GameBaseUI {
public static void main(String[] args) {
BoxesGame2 g = new BoxesGame2(640, 480);
g.show();
}
public BoxesGame2(int width, int height) {
super(width, height);
Random r = new Random();
int color = r.nextInt(Box.colors.length-1);
add( new Box(color,10,10));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -