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

📄 shot.java

📁 java tutorial all about java game design
💻 JAVA
字号:
import java.awt.Graphics;
import java.awt.Color;

public class Shot
{
	private int x_pos;
	private int y_pos;

	private final int radius = 3;

	public Shot(int x, int y)
	{
		x_pos = x;
		y_pos = y;
	}

	public int getYPos()
	{
		return y_pos;
	}

	public void moveShot(int speed)
	{
		y_pos += speed;
	}

	public void drawShot(Graphics g)
	{
		g.setColor(Color.yellow);
		g.fillOval(x_pos, y_pos, radius, radius);
	}
}

⌨️ 快捷键说明

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