本文整理汇总了Java中com.badlogic.gdx.Input.Keys.BACK属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.BACK属性的具体用法?Java Keys.BACK怎么用?Java Keys.BACK使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.BACK属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.LEFT)
controller.leftPressed();
if (keycode == Keys.RIGHT)
controller.rightPressed();
if (keycode == Keys.DOWN)
{
controller.downPressed();
}
if(keycode == Keys.BACK) {
if (isMultiPlayer) {
NextpeerPlugin.reportForfeitForCurrentTournament();
}
dispose();
System.out.println("c");
game.setScreen(new MainScreen(game));
}
return true;
}
示例2: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.BACK) {
if (gameState == GameState.Running) {
pauseGame();
}
else if (gameState == GameState.Paused) {
gameState = GameState.Running;
giveFocus();
}
else if (gameState == GameState.GameOver) {
goToMainMenu();
}
}
return false;
}
示例3: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.BACK || keycode == Keys.ESCAPE) {
if (currentScene == gameScene) {
if (gameManager.isGameActive()) {
setScene(ISceneManager.IntroScene);
}
}
else if (currentScene instanceof com.igorcrevar.goingunder.scenes.TutorialScene) {
setScene(ISceneManager.IntroScene);
}
else {
Gdx.app.exit();
}
return true;
}
return false;
}
示例4: keyDown
@Override
public boolean keyDown(int keycode) {
boolean returnValue = super.keyDown(keycode);
if (keycode == Keys.BACK) {
if (game.isMenuShown()) {
JewelThief.getInstance().switchToMainMenu();
return true;
} else {
game.showMenu();
return true;
}
}
return returnValue;
}
示例5: keyDown
@Override
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.BACK:
return onBack();
case Keys.ESCAPE:
return onBack();
case Keys.MENU:
return onMenu();
case Keys.F1:
return onMenu();
}
return false;
}
示例6: keyUp
@Override
public boolean keyUp(int keycode) {
if(keycode==Keys.ESCAPE || keycode==Keys.BACK)
{
Gdx.app.log("GameScreen", "quit");
game.switchToMainMenu();
return true;
}
return false;
}
示例7: keyDown
public boolean keyDown(int keycode) {
if(keycode == Keys.BACK) {
dispose();
game.setScreen(new MainScreen(game));
}
return true;
}
示例8: keyDown
public boolean keyDown(int keycode) {
if(keycode == Keys.BACK) {
dispose();
game.setScreen(new MainScreen(game));
}
return true;
}
示例9: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.BACK) {
if (state == TutorialState.Calibrating
|| state == TutorialState.Step1
|| state == TutorialState.Done) {
game.setScreen(game.mainMenu);
} else if (state == TutorialState.Step2) {
startStep1();
}
return true;
}
return false;
}
示例10: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.BACK) {
game.setScreen(game.mainMenu);
return true;
}
return false;
}
示例11: keyDown
public boolean keyDown(int keycode) {
if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)){
Gdx.app.exit();
}
return false;
}
示例12: keyDown
public boolean keyDown(int keycode) {
if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)){
Gdx.app.exit();
}
return false;
}
示例13: keyDown
@Override
public boolean keyDown (int keycode) {
if ( keycode == Keys.X || keycode == Keys.BACK) {
if (!menuPressed) {
menuPressed = true;
}
}
return false;
}
示例14: keyDown
@Override
public boolean keyDown(InputEvent event, int keyCode) {
Game.State gameState = Globals.getGameState();
if (gameState == Game.State.RUNNING || gameState == Game.State.WAIT_FOR_INPUT) {
if (keyCode == Keys.A) {
Player player = Level.getInstance().getPlayer();
if (player != null) {
player.jump();
}
}
}
switch (keyCode) {
case Keys.BACK:
if (mainMenuOnBack) {
// TODO: Game.instance.setScreen(new MainMenu(Game.instance));
}
break;
case Keys.ESCAPE:
Gdx.app.exit();
break;
case Keys.D:
Globals.debugPhysics = !Globals.debugPhysics;
break;
case Keys.C:
DAO.getInstance().clear();
break;
case Keys.P:
Globals.printDebugInfo = !Globals.printDebugInfo;
break;
case Keys.E:
Globals.customCameraInfo = !Globals.customCameraInfo;
MainCamera.getInstance().setPlayerFocus(true);
break;
case Keys.Q:
MainCamera.getInstance().takeScreenshot();
break;
case Keys.ENTER:
if (Globals.getGameState() == Game.State.LEVEL_COMPLETE) {
HUD.getInstance().hideLevelComplete();
}
Level.getInstance().loadNext();
break;
default:
if (Level.getInstance().getPlayer() != null &&
Globals.getGameState() == Game.State.WAIT_FOR_INPUT) {
Globals.setGameState(Game.State.RUNNING);
}
return false;
}
return true;
}
示例15: keyDown
public boolean keyDown(int keycode) {
if(NerdShooter.shooter.useKeys){
if (keycode == NerdShooter.shooter.keys[0]){
controller.leftPressed(-1);
}
if (keycode == NerdShooter.shooter.keys[1]){
controller.rightPressed(-1);
}
if (keycode == NerdShooter.shooter.keys[2]){
controller.jumpPressed(-1);
}
if (keycode == NerdShooter.shooter.keys[3]){
controller.firePressed(-1);
}
} else {
if (keycode == Keys.LEFT){
controller.leftPressed(-1);
}
if (keycode == Keys.RIGHT){
controller.rightPressed(-1);
}
if (keycode == Keys.SPACE){
controller.jumpPressed(-1);
}
if (keycode == Keys.X){
controller.firePressed(-1);
}
}
if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)){
finishLevel(ExitBlock.EXIT_NOCLEAR);
}
if (keycode == Keys.S && NerdShooter.sanic){
NerdShooter.sanic = false;
jaxon.loadTextures();
StartScreen.reloadMusic();
} else if (keycode == Keys.S && !NerdShooter.sanic){
NerdShooter.sanic = true;
jaxon.loadTextures();
StartScreen.reloadMusic();
}
if (keycode == Keys.NUM_1){
jaxon.inventory.setSelctedItem(3);
}
if (keycode == Keys.NUM_2){
jaxon.inventory.setSelctedItem(2);
}
if (keycode == Keys.NUM_3){
jaxon.inventory.setSelctedItem(1);
}
if (keycode == Keys.NUM_4){
jaxon.inventory.setSelctedItem(0);
}
return true;
}