if(Game.gameRoom == Room.RoomThree){
if(key != KeyEvent.VK_SPACE){
keycode = e.getKeyCode();
Code += KeyEvent.getKeyText(keycode);
Code = Code.toLowerCase();
System.out.println(Code);
if(Code == "switch horses"){
handler.addObject(new KeysBtn(300, 385, ID.Key));
System.out.println("Correct");
Code = "";
}
}
对于这个代码,它键入了我在键盘上键入的唯一问题,即使我输入了代码“切换马”,但它不能打印正确的安慰。