当前位置: 首页>>代码示例>>Java>>正文


Java Keys.BACK属性代码示例

本文整理汇总了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;
}
 
开发者ID:Nextpeer,项目名称:SkiFun,代码行数:22,代码来源:GameScreen.java

示例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;
}
 
开发者ID:raatmarien,项目名称:Point-and-Hit,代码行数:16,代码来源:GameScreen.java

示例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;
}
 
开发者ID:igorcrevar,项目名称:GoingUnder,代码行数:20,代码来源:GameListener.java

示例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;
}
 
开发者ID:cdetamble,项目名称:jewelthief,代码行数:14,代码来源:GameScreenInputAdapter.java

示例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;
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:14,代码来源:AbstractScreen.java

示例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;
}
 
开发者ID:stdio2016,项目名称:ShapeClear,代码行数:10,代码来源:GameScreen.java

示例7: keyDown

public boolean keyDown(int keycode) {
       if(keycode == Keys.BACK) {
       	dispose();
           game.setScreen(new MainScreen(game));
       }

	return true;
}
 
开发者ID:Nextpeer,项目名称:SkiFun,代码行数:8,代码来源:GameOverScreen.java

示例8: keyDown

public boolean keyDown(int keycode) {
       if(keycode == Keys.BACK) {    	
       	dispose();
           game.setScreen(new MainScreen(game));
       }

	return true;
}
 
开发者ID:Nextpeer,项目名称:SkiFun,代码行数:8,代码来源:CreditsScreen.java

示例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;
}
 
开发者ID:raatmarien,项目名称:Point-and-Hit,代码行数:14,代码来源:TutorialScreen.java

示例10: keyDown

@Override
public boolean keyDown(int keycode) {
	if (keycode == Keys.BACK) {
		game.setScreen(game.mainMenu);
		return true;
	}
	return false;
}
 
开发者ID:raatmarien,项目名称:Point-and-Hit,代码行数:8,代码来源:CreditsScreen.java

示例11: keyDown

public boolean keyDown(int keycode) {
    if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)){
        Gdx.app.exit();
    }

    return false;
}
 
开发者ID:Xemplar,项目名称:NerdShooter,代码行数:7,代码来源:CompletedLevel.java

示例12: keyDown

public boolean keyDown(int keycode) {
    if ((keycode == Keys.BACK) || (keycode == Keys.ESCAPE)){
        Gdx.app.exit();
    }
    
    return false;
}
 
开发者ID:Xemplar,项目名称:NerdShooter,代码行数:7,代码来源:StartScreen.java

示例13: keyDown

@Override
  public boolean keyDown (int keycode) {
if ( keycode == Keys.X || keycode == Keys.BACK) {
 if (!menuPressed) {
	 menuPressed = true;
 }
}
return false;
  }
 
开发者ID:Mknsri,项目名称:Drunk-Toss,代码行数:9,代码来源:Input.java

示例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;
}
 
开发者ID:alexschimpf,项目名称:joe,代码行数:55,代码来源:InputListener.java

示例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;
}
 
开发者ID:Xemplar,项目名称:NerdShooter,代码行数:58,代码来源:GameScreen.java


注:本文中的com.badlogic.gdx.Input.Keys.BACK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。