📄 gold.java
字号:
import java.awt.*;
public class Gold {
//The random position of gold.
private int xGold ;
private int yGold ;
//The size of gole.
private final int SIZE = 5;
public Gold(int x, int y) {
xGold = x;
yGold = y;
}
//Display the gold in the random position.
public void draw(Graphics g){
g.setColor(Color.ORANGE);
g.fillOval(xGold - SIZE, yGold - SIZE, SIZE * 2, SIZE * 2);
}
//information about the current gold.
public int getCentreX(){
return xGold;
}
public int getCentreY(){
return yGold;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -