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

📄 gold.java

📁 一个基于Java的小游戏
💻 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 + -