本文整理汇总了Java中com.badlogic.gdx.Input.Keys.C属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.C属性的具体用法?Java Keys.C怎么用?Java Keys.C使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.C属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyDown
@Override
public boolean keyDown(InputEvent event, int keyCode) {
switch (keyCode) {
case Keys.ESCAPE:
Gdx.app.exit();
break;
case Keys.Z:
sizeScale = Math.max(0.1f, sizeScale - 0.1f);
break;
case Keys.X:
sizeScale += 0.1f;
break;
case Keys.C:
ParticleEffectManager.getInstance().clearLiveEffects();
break;
case Keys.D:
Globals.printDebugInfo = !Globals.printDebugInfo;
break;
}
return true;
}
示例2: setKeyAssign
public void setKeyAssign(Mode mode, boolean enable) {
switch (mode) {
case BEAT_5K:
case BEAT_7K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT };
break;
case BEAT_10K:
case BEAT_14K:
default:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
break;
case POPN_5K:
case POPN_9K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.G, Keys.B };
break;
case KEYBOARD_24K:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
keys = Arrays.copyOf(keys, 26);
break;
case KEYBOARD_24K_DOUBLE:
keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT, Keys.COMMA, Keys.L, Keys.PERIOD, Keys.SEMICOLON, Keys.SLASH, Keys.APOSTROPHE,
Keys.UNKNOWN, Keys.SHIFT_RIGHT, Keys.CONTROL_RIGHT };
keys = Arrays.copyOf(keys, 52);
break;
}
if(!enable) {
Arrays.fill(keys, -1);
}
start = Keys.Q;
select = Keys.W;
}
示例3: 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);
}
示例4: 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;
}
示例5: 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;
}
示例6: validate
public void validate(int keys) {
if (keyboard.keys == null) {
keyboard.keys = new int[] { Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.F, Keys.V, Keys.SHIFT_LEFT,
Keys.CONTROL_LEFT };
}
if (keyboard.keys.length != keys) {
keyboard.keys = Arrays.copyOf(keyboard.keys, keys);
}
int index = 0;
for (ControllerConfig c : controller) {
if (c.keys == null) {
c.keys = new int[] { BMKeys.BUTTON_4, BMKeys.BUTTON_7, BMKeys.BUTTON_3, BMKeys.BUTTON_8,
BMKeys.BUTTON_2, BMKeys.BUTTON_5, BMKeys.LEFT, BMKeys.UP, BMKeys.DOWN };
}
if (c.keys.length != keys) {
int[] newkeys = new int[keys];
Arrays.fill(newkeys, -1);
for (int i = 0; i < c.keys.length && index < newkeys.length; i++, index++) {
newkeys[index] = c.keys[i];
}
c.keys = newkeys;
}
}
if (midi.keys == null) {
midi.keys = new MidiConfig().keys;
}
if (midi.keys.length != keys) {
midi.keys = Arrays.copyOf(midi.keys, keys);
}
// KB, コントローラー, Midiの各ボタンについて排他的処理を実施
boolean[] exclusive = new boolean[keyboard.keys.length];
validate0(keyboard.keys, exclusive);
for(int i = 0;i < controller.length;i++) {
validate0(controller[i].keys, exclusive);
}
for(int i = 0;i < midi.getKeys().length;i++) {
if(exclusive[i]) {
midi.getKeys()[i] = null;
}
}
}