?? 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 + -