我正在嘗試使用java microedition製作2D遊戲,我只是想讓我的控制更流暢,但問題是當我按下UP鍵時按下LEFT鍵條件不起作用不知道爲什麼J2ME Controls Left and UP
public void moveJet2() throws IOException{
int gameAction = getKeyStates();
if(gameAction==LEFT_PRESSED && gameAction==UP_PRESSED){
padX-=padXVel;
padY-=padYVel;
}
else if(gameAction==RIGHT_PRESSED){
padX += padXVel;
}
else if(gameAction==UP_PRESSED){
padY-=padYVel;
}
else if(gameAction==DOWN_PRESSED){
padY+=padYVel;
}
}
非常感謝你先生:) – xFaceless