📄 shot.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 + -