📄 mainrole.java
字号:
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
/*
* Created on 2005-7-10
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author Yongzi
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Mainrole extends Sprite {
int x;
int y;
int selecty=145; //菜单选择钮的Y坐标
int isduck=1;
int lastx;
int lasty;
int roomx,roomy;
int directionup=12,directiondown=0, directionleft=4,directionright=8;
/**
* @param arg0
*/
public Mainrole(Image img ,int width, int height, int positionx, int positiony,int roomx2,int roomy2) {
super(img,width,height);
x=positionx;
y=positiony;
roomx=roomx2;
roomy=roomy2;
}
public void move(int increasex, int increasey)
{
x=x+increasex;
y=y+increasey;
lastx=increasex;
lasty=increasey;
}
public void moveroom(int increasex, int increasey)
{
roomx=roomx+increasex;
roomy=roomy+increasey;
lastx=increasex;
lasty=increasey;
}
void unmove() {
move(-lastx, -lasty);
}
void unmoveroom() {
moveroom(-lastx, -lasty);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -