Java Code Examples for org.newdawn.slick.Input#KEY_1

The following examples show how to use org.newdawn.slick.Input#KEY_1 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestState3.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * @see org.newdawn.slick.state.BasicGameState#keyReleased(int, char)
 */
public void keyReleased(int key, char c) {
	if (key == Input.KEY_DOWN) {
		selected++;
		if (selected >= options.length) {
			selected = 0;
		}
	}
	if (key == Input.KEY_UP) {
		selected--;
		if (selected < 0) {
			selected = options.length - 1;
		}
	}
	if (key == Input.KEY_1) {
		game.enterState(TestState1.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
	}
	if (key == Input.KEY_2) {
		game.enterState(TestState2.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
	}
}
 
Example 2
Source File: TestState2.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.state.BasicGameState#keyReleased(int, char)
 */
public void keyReleased(int key, char c) {
	if (key == Input.KEY_1) {
		game.enterState(TestState1.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
	}
	if (key == Input.KEY_3) {
		game.enterState(TestState3.ID, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
	}
}
 
Example 3
Source File: ClipTest.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.BasicGame#keyPressed(int, char)
 */
public void keyPressed(int key, char c) {
	if (key == Input.KEY_1) {
		world = false;
		clip = false;
	}
	if (key == Input.KEY_2) {
		world = false;
		clip = true;
	}
	if (key == Input.KEY_3) {
		world = true;
		clip = false;
	}
}