當前位置: 首頁>>代碼示例>>Java>>正文


Java Keys.P屬性代碼示例

本文整理匯總了Java中com.badlogic.gdx.Input.Keys.P屬性的典型用法代碼示例。如果您正苦於以下問題:Java Keys.P屬性的具體用法?Java Keys.P怎麽用?Java Keys.P使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.badlogic.gdx.Input.Keys的用法示例。


在下文中一共展示了Keys.P屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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);
}
 
開發者ID:ahmetkasif,項目名稱:KittenMaxit,代碼行數:9,代碼來源:Menu.java

示例2: loadDefault

public void loadDefault() {
	//player
	forward = Keys.W;
	right = Keys.D;
	left = Keys.A;
	back = Keys.S;
	shoot = Keys.SPACE;
	changeVehicle = Keys.G;
	land = Keys.T;
	
	//ui
	toggleHUD = Keys.H;
	toggleEdgeMap = Keys.M;
	toggleSpaceMap = Keys.P;
	
	//screen
	fullscreen = Keys.F11;
	vsync = Keys.F8;
	zoomOut = Keys.MINUS;
	zoomIn = Keys.EQUALS;
	resetZoom = Keys.PERIOD;
	zoomCharacter = Keys.SLASH;
	zoomSpace = Keys.COMMA;
	rotateLeft = Keys.LEFT_BRACKET;
	rotateRight = Keys.RIGHT_BRACKET;
	
	//debug menu
	toggleDebug = Keys.F3;
	togglePos = Keys.NUMPAD_0;
	toggleComponents = Keys.NUMPAD_1;
	toggleBounds = Keys.NUMPAD_2;
	toggleFPS = Keys.NUMPAD_3;
	toggleOrbit = Keys.NUMPAD_4;
	toggleVector = Keys.NUMPAD_5;
	toggleMenu = Keys.NUMPAD_9;		
}
 
開發者ID:0XDE57,項目名稱:SpaceProject,代碼行數:36,代碼來源:KeyConfig.java

示例3: 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


注:本文中的com.badlogic.gdx.Input.Keys.P屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。