📄 plane.java
字号:
package Src;
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.*;
/*
* 飞机类//飞机象素30,40
* 子弹在左上半区开始,飞机就应该在右下半区开始
*/
public class Plane extends Sprite {
private int thisx,thisy;//屏幕长宽
Plane(Image e,int x,int y)
{
super(e,x,y);
super.setRefPixelPosition(x/2, y/2);
}
public void Planeinto(int w,int h)//构造飞机
{
this.thisx=w;
this.thisy=h;
}
public void DrawPlane(Graphics g)
{
this.setPosition(thisx-40, thisy-40);
this.paint(g);
}
public void setPosionx(int thisx)//设置飞机X位置
{
this.thisx=thisx;
}
public void setPosiony(int thisy)//设置飞机X位置
{
this.thisy=thisy;
}
public int GetPosionx()//返回飞机X位置
{
return this.thisx;
}
public int GetPosiony()//返回飞机X位置
{
return this.thisy;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -