本文整理汇总了Java中com.badlogic.gdx.Input.Keys.E属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.E属性的具体用法?Java Keys.E怎么用?Java Keys.E使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.E属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyPressed
public void onKeyPressed(UserEvent e) {
datapointer.playerinputconvertor.onKeyPressed(e);
switch (e.value) {
case Keys.ESCAPE:
parent.parent.substate = new InGameMenuState(parent.parent);
break;
case Keys.A:
activedcapacity = (byte) ((activedcapacity == 1 || datapointer.player.inventory
.getCapFromId((byte) 1) == null) ? 0 : 1);
break;
case Keys.Z:
activedcapacity = (byte) ((activedcapacity == 2 || datapointer.player.inventory
.getCapFromId((byte) 2) == null) ? 0 : 2);
break;
case Keys.E:
activedcapacity = (byte) ((activedcapacity == 3 || datapointer.player.inventory
.getCapFromId((byte) 3) == null) ? 0 : 3);
break;
}
}
示例2: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.UP) {
upPressed = true;
} else if (keycode == Keys.LEFT) {
leftPressed = true;
} else if (keycode == Keys.DOWN) {
downPressed = true;
} else if (keycode == Keys.RIGHT) {
rightPressed = true;
}
if (keycode == Keys.E) {
ePressed = true;
} else if (keycode == Keys.W) {
wPressed = true;
}
return false;
}
示例3: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.UP) {
upPressed = false;
} else if (keycode == Keys.LEFT) {
leftPressed = false;
} else if (keycode == Keys.DOWN) {
downPressed = false;
} else if (keycode == Keys.RIGHT) {
rightPressed = false;
}
// When releasing the action key, reset the key delay so they can be pressed again immediately
if (keycode == Keys.E) {
ePressed = false;
actionDelay = 0;
}
return false;
}
示例4: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.UP) {
upPressed = true;
} else if (keycode == Keys.LEFT) {
leftPressed = true;
} else if (keycode == Keys.DOWN) {
downPressed = true;
} else if (keycode == Keys.RIGHT) {
rightPressed = true;
}
if (keycode == Keys.E) {
firePressed = true;
} else if (keycode == Keys.W) {
shieldPressed = true;
}
if (keycode == Keys.ENTER) {
startJustPressed = true;
}
return false;
}
示例5: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.UP) {
upPressed = false;
} else if (keycode == Keys.LEFT) {
leftPressed = false;
} else if (keycode == Keys.DOWN) {
downPressed = false;
} else if (keycode == Keys.RIGHT) {
rightPressed = false;
}
// When releasing the action key, reset the key delay so they can be pressed again immediately
if (keycode == Keys.E) {
firePressed = false;
actionDelay = 0;
}
return false;
}
示例6: onTurn
@Override
/*********************************************************
* Called on every turn
* @return true if something actually happened in a turn
* (if false, the player is NOT moved in the queue!)
*********************************************************/
public boolean onTurn(){
super.onTurn();
Core.redraw = true;
Integer log = input.checkKeys();
if (log == null) return false;
switch (log){
case Keys.LEFT:
move(-1, 0);
break;
case Keys.RIGHT:
move(1, 0);
break;
case Keys.UP:
move(0, 1);
break;
case Keys.DOWN:
move(0, -1);
break;
case Keys.E:
Core.game.setScreen(new DungeonOverviewScreen(holder.getDungeon().getWorld()));
case Keys.X:
holder.useStairs();
holder.getDungeon().getWorld().changeFloors(holder.getDungeon());
break;
default:
return false;
}
housekeep();
return true;
}
示例7: checkKeys
/********************************************
* Check keys for presses
* Automatically converts synonymous keys
* @return the highest priority active key
********************************************/
public Integer checkKeys(){
if (checkKey(Keys.UP) || checkKey(Keys.W)) return Keys.UP;
if (checkKey(Keys.DOWN) || checkKey(Keys.S)) return Keys.DOWN;
if (checkKey(Keys.LEFT) || checkKey(Keys.A)) return Keys.LEFT;
if (checkKey(Keys.RIGHT) || checkKey(Keys.D)) return Keys.RIGHT;
if (checkNewKey(Keys.X)) return Keys.X;
if (checkNewKey(Keys.E)) return Keys.E;
return null;
}
示例8: keyUp
public boolean keyUp(int k) {
if(mode==0){
if(k == Keys.W || k == Keys.UP) MyInput.setKey(Input.UP, false);
if(k == Keys.A || k == Keys.LEFT) MyInput.setKey(Input.LEFT, false);
if(k == Keys.S || k == Keys.DOWN) MyInput.setKey(Input.DOWN, false);
if(k == Keys.D || k == Keys.RIGHT) MyInput.setKey(Input.RIGHT, false);
if(k == Keys.SPACE) MyInput.setKey(Input.JUMP, false);
if(k == Keys.Q || k == Keys.CONTROL_RIGHT) MyInput.setKey(Input.INTERACT, false);
if(k == Keys.E || k == Keys.NUMPAD_0) MyInput.setKey(Input.ATTACK, false);
if(k == Keys.SHIFT_LEFT) MyInput.setKey(Input.SPECIAL, false);
if(k == Keys.CONTROL_LEFT || k == Keys.Z) MyInput.setKey(Input.RUN, false);
if(k == Keys.R || k == Keys.NUMPAD_1) MyInput.setKey(Input.USE, false);
if(k == Keys.ESCAPE) MyInput.setKey(Input.PAUSE, false);
if(k == Keys.ENTER) MyInput.setKey(Input.ENTER, false);
if(k == Keys.TAB) MyInput.setKey(Input.RESPAWN, false);
if(k == Keys.NUMPAD_8 || k == Keys.U) MyInput.setKey(Input.DEBUG_UP, false);
if(k == Keys.NUMPAD_2 || k == Keys.J) MyInput.setKey(Input.DEBUG_DOWN, false);
if(k == Keys.NUMPAD_4 || k == Keys.I) MyInput.setKey(Input.DEBUG_LEFT, false);
if(k == Keys.NUMPAD_6 || k == Keys.O) MyInput.setKey(Input.DEBUG_RIGHT, false);
if(k == Keys.NUMPAD_7 || k == Keys.LEFT_BRACKET) MyInput.setKey(Input.DEBUG_LEFT2, false);
if(k == Keys.NUMPAD_9 || k == Keys.RIGHT_BRACKET) MyInput.setKey(Input.DEBUG_RIGHT2, false);
if(k == Keys.M) MyInput.setKey(Input.DEBUG_CENTER, false);
if(k == Keys.F1) MyInput.setKey(Input.COLLISION, false);
if(k == Keys.F2) MyInput.setKey(Input.LIGHTS, false);
if(k == Keys.F3) MyInput.setKey(Input.DEBUG_TEXT, false);
if(k == Keys.F4) MyInput.setKey(Input.RENDER, false);
if(k == Keys.EQUALS) MyInput.setKey(Input.ZOOM_IN, false);
if(k == Keys.MINUS) MyInput.setKey(Input.ZOOM_OUT, false);
} else {
if(k == Keys.ESCAPE){ MyInput.setKey(Input.PAUSE, false); }
if(k == Keys.SPACE){ MyInput.setKey(Input.JUMP, false); }
if(k == Keys.ENTER){ MyInput.setKey(Input.ENTER, false); }
if(k == Keys.LEFT){ MyInput.setKey(Input.LEFT, false); }
if(k == Keys.RIGHT){ MyInput.setKey(Input.RIGHT, false); }
if(Keys.toString(k).toLowerCase().equals("delete")){ MyInput.setKey(Input.DOWN, false); }
if(k == Keys.SHIFT_LEFT || k == Keys.SHIFT_RIGHT){ MyInput.setKey(Input.UP, false); }
}
return true;
}
示例9: create
@Override
public void create() {
super.create();
play = new Button("Play", 32, 225, Keys.P);
help = new Button("How To Play", 32, 180, Keys.H);
options = new Button("Options", 32, 135, Keys.O);
credits = new Button("Credits", 32, 90, Keys.C);
exit = new Button("Exit", 32, 45, Keys.E);
}
示例10: keyDown
@Override
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.A:
inputController.setLeft(true);
return true;
case Keys.D:
inputController.setRight(true);
return true;
case Keys.W:
inputController.setUp(true);
return true;
case Keys.S:
inputController.setDown(true);
return true;
case Keys.NUM_1:
inputController.setNumberKey(1, true);
return true;
case Keys.NUM_2:
inputController.setNumberKey(2, true);
return true;
case Keys.NUM_3:
inputController.setNumberKey(3, true);
return true;
case Keys.NUM_4:
inputController.setNumberKey(4, true);
return true;
case Keys.Q:
inputController.setSwitchWeapon(true);
return true;
case Keys.E:
inputController.setWeaponAbility(true);
return true;
default:
return false;
}
}
示例11: keyUp
@Override
public boolean keyUp(int keycode) {
switch (keycode) {
case Keys.A:
inputController.setLeft(false);
return true;
case Keys.D:
inputController.setRight(false);
return true;
case Keys.W:
inputController.setUp(false);
return true;
case Keys.S:
inputController.setDown(false);
return true;
case Keys.NUM_1:
inputController.setNumberKey(1, false);
return true;
case Keys.NUM_2:
inputController.setNumberKey(2, false);
return true;
case Keys.NUM_3:
inputController.setNumberKey(3, false);
return true;
case Keys.NUM_4:
inputController.setNumberKey(4, false);
return true;
case Keys.Q:
inputController.setSwitchWeapon(false);
return true;
case Keys.E:
inputController.setWeaponAbility(false);
return true;
default:
return false;
}
}
示例12: keyDown
@Override
public boolean keyDown(int keycode) {
if (currentPlayer == null) return false;
if (keycode == Keys.E){
//TODO: this shoudl be driven by tghe 'action' switch in the controller component
logger.debug("Vehicle Key pressed");
VehicleComponent vehicle = App.engine.mappers.vehicle.get(currentPlayer);
VehicleOperatorComponent operator = App.engine.mappers.vehicleOperator.get(currentPlayer);
if (vehicle != null) vehicle.eject = true;
if (operator != null) operator.enterVehicle = true;
}
return false;
}
示例13: keyUp
@Override
public boolean keyUp(int keycode) {
if (currentPlayer == null) return false;
if (keycode == Keys.E){
logger.debug("Vehicle Key depressed");
VehicleComponent vehicle = App.engine.mappers.vehicle.get(currentPlayer);
VehicleOperatorComponent operator = App.engine.mappers.vehicleOperator.get(currentPlayer);
if (vehicle != null) vehicle.eject = false;
if (operator != null) operator.enterVehicle = false;
}
return false;
}
示例14: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.UP) {
upPressed = true;
} else if (keycode == Keys.LEFT) {
leftPressed = true;
} else if (keycode == Keys.DOWN) {
downPressed = true;
} else if (keycode == Keys.RIGHT) {
rightPressed = true;
}
if (keycode == Keys.E) {
ePressed = true;
} else if (keycode == Keys.W) {
wPressed = true;
}
if (keycode == Keys.SHIFT_LEFT || keycode == Keys.SHIFT_RIGHT) {
shiftPressed = true;
}
if (keycode == Keys.CONTROL_LEFT || keycode == Keys.CONTROL_RIGHT) {
ctrlPressed = true;
}
return false;
}
示例15: keyUp
@Override
public boolean keyUp(int keycode) {
// When releasing keys, reset the key delay so they can be pressed again immediately
if (keycode == Keys.UP) {
upPressed = false;
movementDelay = 0;
} else if (keycode == Keys.LEFT) {
leftPressed = false;
movementDelay = 0;
} else if (keycode == Keys.DOWN) {
downPressed = false;
movementDelay = 0;
} else if (keycode == Keys.RIGHT) {
rightPressed = false;
movementDelay = 0;
}
if (keycode == Keys.E) {
ePressed = false;
actionDelay = 0;
} else if (keycode == Keys.W) {
wPressed = false;
useDelay = 0;
}
if (keycode == Keys.SHIFT_LEFT || keycode == Keys.SHIFT_RIGHT) {
shiftPressed = false;
}
if (keycode == Keys.CONTROL_LEFT || keycode == Keys.CONTROL_RIGHT) {
ctrlPressed = false;
}
return false;
}