當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。