本文整理汇总了Java中org.newdawn.slick.Input.KEY_UP属性的典型用法代码示例。如果您正苦于以下问题:Java Input.KEY_UP属性的具体用法?Java Input.KEY_UP怎么用?Java Input.KEY_UP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.newdawn.slick.Input
的用法示例。
在下文中一共展示了Input.KEY_UP属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyPressed
/**
* @see org.newdawn.slick.BasicGame#keyPressed(int, char)
*/
public void keyPressed(int key, char c) {
if (key == Input.KEY_ESCAPE) {
System.exit(0);
}
if (key == Input.KEY_Q) {
scaleUp = true;
}
if (key == Input.KEY_A) {
scaleDown = true;
}
if( key == Input.KEY_LEFT) {
moveLeft = true;
}
if( key == Input.KEY_UP ) {
moveUp = true;
}
if( key == Input.KEY_RIGHT ) {
moveRight = true;
}
if( key == Input.KEY_DOWN ) {
moveDown = true;
}
}
示例2: keyReleased
/**
* @see org.newdawn.slick.BasicGame#keyReleased(int, char)
*/
public void keyReleased(int key, char c) {
if (key == Input.KEY_Q) {
scaleUp = false;
}
if (key == Input.KEY_A) {
scaleDown = false;
}
if( key == Input.KEY_LEFT) {
moveLeft = false;
}
if( key == Input.KEY_UP ) {
moveUp = false;
}
if( key == Input.KEY_RIGHT ) {
moveRight = false;
}
if( key == Input.KEY_DOWN ) {
moveDown = false;
}
}
示例3: keyReleased
/**
* @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));
}
}
示例4: keyPressed
@Override
public void keyPressed(int key, char c) {
switch (key) {
case Input.KEY_UP:
this.direction = 0;
this.moving = true;
break;
case Input.KEY_LEFT:
this.direction = 1;
this.moving = true;
break;
case Input.KEY_DOWN:
this.direction = 2;
this.moving = true;
break;
case Input.KEY_RIGHT:
this.direction = 3;
this.moving = true;
break;
}
}
示例5: setControlKeys
private void setControlKeys() {
if(this instanceof PacMan) {
comands[0] = Input.KEY_UP;
comands[1] = Input.KEY_DOWN;
comands[2] = Input.KEY_LEFT;
comands[3] = Input.KEY_RIGHT;
}
if(this instanceof Blinky) {
comands[0] = Input.KEY_W;
comands[1] = Input.KEY_S;
comands[2] = Input.KEY_A;
comands[3] = Input.KEY_D;
}
if(this instanceof Clyde) {
comands[0] = Input.KEY_T;
comands[1] = Input.KEY_G;
comands[2] = Input.KEY_F;
comands[3] = Input.KEY_H;
}
if(this instanceof Inky) {
comands[0] = Input.KEY_I;
comands[1] = Input.KEY_K;
comands[2] = Input.KEY_J;
comands[3] = Input.KEY_L;
}
if(this instanceof Pinky) {
comands[0] = Input.KEY_5;
comands[1] = Input.KEY_2;
comands[2] = Input.KEY_1;
comands[3] = Input.KEY_3;
}
}