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


Java Keys.M属性代码示例

本文整理汇总了Java中com.badlogic.gdx.Input.Keys.M属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.M属性的具体用法?Java Keys.M怎么用?Java Keys.M使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.badlogic.gdx.Input.Keys的用法示例。


在下文中一共展示了Keys.M属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

@Override
public void create() {
	super.create();

	menu = new Button("Menu", 32, 45, Keys.M);

	hint1 = new Text(
			"1) ESCAPE key makes you return to the previous screen, only if you are not on main menu. If this is the case, you exit the application!",
			64, 630);
	hint2 = new Text(
			"2) Returning menu and then coming back to play restarts the game, so you don't have to re-open the application for playing again!",
			64, 585);
	hint3 = new Text(
			"3) Kitten Maxit is a turn based point cathcing game, on your turn you select a point and it is added to your score, if you get higher score att the end, you beat your opponent :)",
			64, 540);
	hint4 = new Text(
			"4) Kitten Maxit developed at April 2015 using Slick2D, after Slick2D no longer gets updated, we remade it using LibGDX at Feb 2016 and renamed to Kitten Maxit+ !",
			64, 495);
}
 
开发者ID:ahmetkasif,项目名称:KittenMaxit,代码行数:19,代码来源:Help.java

示例2: 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;
}
 
开发者ID:JayKEm,项目名称:Aftamath,代码行数:39,代码来源:MyInputProcessor.java

示例3: create

@Override
public void create() {
	super.create();

	menu = new Button("Menu", 32, 45, Keys.M);

	x = 0;

	brand = new Text("Kitten Maxit: Plus", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x);

	titleDev = new Text("Developers:", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 40);
	dev1 = new Text("Abdullah Oguk", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 70);
	dev2 = new Text("Ahmet Kasif", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 90);
	dev3 = new Text("Hilmi Araz", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 110);
	dev4 = new Text("Mustafa Ozdemir", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 130);
	dev5 = new Text("Ugur Kafali", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 150);

	titleGfx = new Text("Graphics and UI Design", Gdx.graphics.getWidth() / 2 - 160,
			Gdx.graphics.getHeight() / 2 - x - 190);
	gfx1 = new Text("Ahmet Kasif", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 220);

	titleAlg = new Text("AI", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 260);
	alg1 = new Text("Abdullah Oguk", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 290);
	alg2 = new Text("Ahmet Kasif", Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - x - 310);

	kitten = new Sprite(new Texture(Gdx.files.internal("gfx/ui/codeaia.png")));
	kitten.setPosition(Gdx.graphics.getWidth() / 2 - 40 - kitten.getWidth() / 2,
			Gdx.graphics.getHeight() / 2 - x - 330 - kitten.getHeight());

	footBrand = new Text("Kitten Maxit - Plus v1.1 / Feb 2016", Gdx.graphics.getWidth() / 2 - 160,
			Gdx.graphics.getHeight() / 2 - x - 360 - kitten.getHeight());
}
 
开发者ID:ahmetkasif,项目名称:KittenMaxit,代码行数:32,代码来源:Credits.java

示例4: create

@Override
public void create() {
	super.create();
	mapSize = 7;
	player1 = new Player("You");
	player2 = new Player("Computer (Easy)");

	turn = true;

	p1Score = new Button(player1.getName() + ": " + 0, 32, 540);
	p1Score.setWidth((2 * p1Score.getOffset()) + p1Score.getLayout().width + 16);
	p2Score = new Button(player2.getName() + ": " + 0, 1088, 540);
	p2Score.setWidth((2 * p2Score.getOffset()) + p2Score.getLayout().width + 16);

	table = new NinePatch(new Texture(Gdx.files.internal("gfx/ui/np.png")), 16, 16, 16, 16);

	for (int i = 0; i < mapSize; i++) {
		for (int k = 0; k < mapSize; k++) {
			maxitmap[i][k] = new Number((1280 - (72 * mapSize + 24)) / 2 + i * 72 + 16,
					(720 - (72 * mapSize + 24)) / 2 + k * 72 + 16);
		}
	}

	menu = new Button("Menu", 32, 45, Keys.M);
	reset = new Button("Reset", 32, 90, Keys.R);

	spointx = (new Random()).nextInt(mapSize);
	spointy = (new Random()).nextInt(mapSize);

	maxitmap[spointx][spointy].setState(3);
}
 
开发者ID:ahmetkasif,项目名称:KittenMaxit,代码行数:31,代码来源:Singleplayer.java

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

示例6: keyDown

@Override
public boolean keyDown(int keycode) {

	if (keycode == Keys.X && keys.containsKey(Keys.CONTROL_LEFT)) {
		System.exit(0);
	}

	if (keycode == Keys.M) {
		if(SoundManager.masterSound>0.1f) {
			SoundManager.stopAllSounds();
			SoundManager.pauseAllMusiques();
			SoundManager.masterSound = 0.f;				
			SoundManager.masterMusic = 0.f;				
		}
		else {
			SoundManager.masterSound = 0.3f;				
			SoundManager.masterMusic = 0.3f;				
		}
	}

	if ((keycode == Keys.SPACE) && InGame.dead) {
		InGame.score=5000;
		InGame.maxScore=0;
		InGame.nbKills=0;
		InGame.totalTime=0;
		InGame.speedEnergy = 250;
		InGame.dead=false;
		InGame.rouge = 0;
		InGame.player.timeBeforeRespawn = 0;
		Gdx.input.setCursorCatched(true);
		PAUSED = false;
	}

	if (keycode == Keys.UP) {
		STRAFE_LEFT = Keys.LEFT;
		STRAFE_RIGHT = Keys.RIGHT;
		FORWARD = Keys.UP;
		BACKWARD = Keys.DOWN;
	}

	if (keycode == Keys.C) {
		ScreenshotFactory.saveScreenshot();
	}

	if (keycode == Keys.W) {
		STRAFE_LEFT = Keys.A;
		STRAFE_RIGHT = Keys.D;
		FORWARD = Keys.W;
		BACKWARD = Keys.S;
	}

	if (keycode == Keys.Q) {
		STRAFE_LEFT = Keys.Q;
		STRAFE_RIGHT = Keys.D;
		FORWARD = Keys.Z;
		BACKWARD = Keys.S;
	}

	keys.put(keycode, keycode);
	return true;
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:61,代码来源:CameraController.java

示例7: keyDown

public boolean keyDown(int k) {
		if(mode==0){
			if(k == Keys.W || k == Keys.UP) MyInput.setKey(Input.UP, true);
			if(k == Keys.A || k == Keys.LEFT) MyInput.setKey(Input.LEFT, true);
			if(k == Keys.S || k == Keys.DOWN) MyInput.setKey(Input.DOWN, true);
			if(k == Keys.D || k == Keys.RIGHT) MyInput.setKey(Input.RIGHT, true);
			if(k == Keys.SPACE) MyInput.setKey(Input.JUMP, true);
			if(k == Keys.Q || k == Keys.CONTROL_RIGHT) MyInput.setKey(Input.INTERACT, true);
			if(k == Keys.E || k == Keys.NUMPAD_0) MyInput.setKey(Input.ATTACK, true);
			if(k == Keys.SHIFT_LEFT) MyInput.setKey(Input.SPECIAL, true);
			if(k == Keys.CONTROL_LEFT || k == Keys.Z) MyInput.setKey(Input.RUN, true);
			if(k == Keys.R || k == Keys.NUMPAD_1) MyInput.setKey(Input.USE, true);
			if(k == Keys.ESCAPE) MyInput.setKey(Input.PAUSE, true);
			if(k == Keys.ENTER) MyInput.setKey(Input.ENTER, true);
			if(k == Keys.TAB) MyInput.setKey(Input.RESPAWN, true);
			if(k == Keys.NUMPAD_8 || k == Keys.U) MyInput.setKey(Input.DEBUG_UP, true);
			if(k == Keys.NUMPAD_2 || k == Keys.J) MyInput.setKey(Input.DEBUG_DOWN, true);
			if(k == Keys.NUMPAD_4 || k == Keys.I) MyInput.setKey(Input.DEBUG_LEFT, true);
			if(k == Keys.NUMPAD_6 || k == Keys.O) MyInput.setKey(Input.DEBUG_RIGHT, true);
			if(k == Keys.NUMPAD_7 || k == Keys.LEFT_BRACKET) MyInput.setKey(Input.DEBUG_LEFT2, true);
			if(k == Keys.NUMPAD_9 || k == Keys.RIGHT_BRACKET) MyInput.setKey(Input.DEBUG_RIGHT2, true);
			if(k == Keys.M) MyInput.setKey(Input.DEBUG_CENTER, true);
			if(k == Keys.F1) MyInput.setKey(Input.COLLISION, true);
			if(k == Keys.F2) MyInput.setKey(Input.LIGHTS, true);
			if(k == Keys.F3) MyInput.setKey(Input.DEBUG_TEXT, true);
			if(k == Keys.F4) MyInput.setKey(Input.RENDER, true);
			if(k == Keys.EQUALS) MyInput.setKey(Input.ZOOM_IN, true);
			if(k == Keys.MINUS) MyInput.setKey(Input.ZOOM_OUT, true);
		} else {
//			System.out.println(k+":"+Keys.toString(k));
			boolean entered = false;
			if(k == Keys.ESCAPE){ entered=true; MyInput.setKey(Input.PAUSE, true); }
			if(k == Keys.SPACE){ entered=true; MyInput.setKey(Input.JUMP, true); }
			if(k == Keys.ENTER){ entered=true; MyInput.setKey(Input.ENTER, true); }
			if(Keys.toString(k).toLowerCase().equals("delete")){ entered=true; MyInput.setKey(Input.DOWN, true); }
			if(k == Keys.LEFT){ entered=true; MyInput.setKey(Input.LEFT, true); }
			if(k == Keys.RIGHT){ entered=true; MyInput.setKey(Input.RIGHT, true); }
			if(k == Keys.HOME){ entered=true; Game.inputIndex = 0;}
			if(k == Keys.END){ entered=true; Game.inputIndex = Game.getInput().length() - 1; }
			if(k == Keys.SHIFT_LEFT || k == Keys.SHIFT_RIGHT){ entered=true; MyInput.setKey(Input.UP, true); }
			
			if(MyInput.isDown(Input.UP)){
				if(k == Keys.NUM_1){ entered = true; Game.addInputChar("!"); }
				if(k == Keys.NUM_2){ entered = true; Game.addInputChar("@"); }
				if(k == Keys.NUM_3){ entered = true; Game.addInputChar("#"); }
				if(k == Keys.NUM_4){ entered = true; Game.addInputChar("$"); }
				if(k == Keys.NUM_5){ entered = true; Game.addInputChar("%"); }
				if(k == Keys.NUM_6){ entered = true; Game.addInputChar("^"); }
				if(k == Keys.NUM_7){ entered = true; Game.addInputChar("&"); }
				if(k == Keys.NUM_8){ entered = true; Game.addInputChar("*"); }
				if(k == Keys.NUM_9){ entered = true; Game.addInputChar("("); }
				if(k == Keys.NUM_0){ entered = true; Game.addInputChar(")"); }
				if(k == Keys.EQUALS){ entered = true; Game.addInputChar("+"); }
				if(k == Keys.MINUS){ entered = true; Game.addInputChar("_"); }
				if(k == Keys.PERIOD){ entered = true; Game.addInputChar(">"); }
				if(k == Keys.COMMA){ entered = true; Game.addInputChar("<"); }
				if(k == Keys.SLASH){ entered = true; Game.addInputChar("?"); }
			}
			
			if(k == Keys.NUMPAD_1){ k = Keys.NUM_1; }
			if(k == Keys.NUMPAD_2){ k = Keys.NUM_2; }
			if(k == Keys.NUMPAD_3){ k = Keys.NUM_3; }
			if(k == Keys.NUMPAD_4){ k = Keys.NUM_4; }
			if(k == Keys.NUMPAD_5){ k = Keys.NUM_5; }
			if(k == Keys.NUMPAD_6){ k = Keys.NUM_6; }
			if(k == Keys.NUMPAD_7){ k = Keys.NUM_7; }
			if(k == Keys.NUMPAD_8){ k = Keys.NUM_8; }
			if(k == Keys.NUMPAD_9){ k = Keys.NUM_9; }
			if(k == Keys.NUMPAD_0){ k = Keys.NUM_0; }
			
			if(!entered && !ignoreKeys.contains(k, false))
				if(MyInput.isDown(Input.UP) || MyInput.isCaps)
					Game.addInputChar(Keys.toString(k));
				else
					Game.addInputChar(Keys.toString(k).toLowerCase());
		}
		
		return true;
	}
 
开发者ID:JayKEm,项目名称:Aftamath,代码行数:79,代码来源:MyInputProcessor.java

示例8: initOptionStage

private void initOptionStage() {
	menu = new Button("Menu", 32, 45, Keys.M);
	graphics = new Button("Graphics", 32, 108, Keys.G);
	audio = new Button("Audio", 32, 144, Keys.A);
}
 
开发者ID:ahmetkasif,项目名称:KittenMaxit,代码行数:5,代码来源:Options.java


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