本文整理汇总了Java中org.newdawn.slick.Input.KEY_A属性的典型用法代码示例。如果您正苦于以下问题:Java Input.KEY_A属性的具体用法?Java Input.KEY_A怎么用?Java Input.KEY_A使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.newdawn.slick.Input
的用法示例。
在下文中一共展示了Input.KEY_A属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
}
示例4: 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;
}
}
示例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;
}
}
示例6: 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_SPACE) {
sound.play();
}
if (key == Input.KEY_B) {
burp.play();
}
if (key == Input.KEY_A) {
sound.playAt(-1, 0, 0);
}
if (key == Input.KEY_L) {
sound.playAt(1, 0, 0);
}
if (key == Input.KEY_RETURN) {
charlie.play(1.0f,1.0f);
}
if (key == Input.KEY_P) {
if (music.playing()) {
music.pause();
} else {
music.resume();
}
}
if (key == Input.KEY_C) {
music.stop();
if (music == musica) {
music = musicb;
} else {
music = musica;
}
music.loop();
}
if (key == Input.KEY_E) {
if (engine.playing()) {
engine.stop();
} else {
engine.loop();
}
}
if (c == '+') {
volume += 1;
setVolume();
}
if (c == '-') {
volume -= 1;
setVolume();
}
}