@Override public boolean isKeyJustPressed (int key) { return input.isKeyJustPressed(key); }
@Override public void render () { if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_1)) { if (mapType != 0) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose(); renderer = new OrthogonalTiledMapRenderer(map, 1f / 32f); } else if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_2)) { if (mapType != 1) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose(); ((OrthoCachedTiledMapRenderer)renderer).setBlending(true); } else if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_3)) { if (mapType != 2) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose(); } else if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_4)) { if (mapType != 3) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose(); } else if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_5)) { if (mapType != 4) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose(); } else if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_6)) { if (mapType != 5) { if (renderer instanceof Disposable) ((Disposable)renderer).dispose();
if (Gdx.input.isKeyJustPressed(Keys.B)) debug = !debug;
animation.action("Attack", 1, 1f, null, 0.2f); if (Gdx.input.isKeyJustPressed(Keys.Z)) ship.parts.get(0).enabled = !ship.parts.get(0).enabled;
private void handleInput() { if (Gdx.input.isKeyJustPressed(Input.Keys.F)) { showFPS = !showFPS; fpsLabel.setVisible(showFPS); } }
public void handleInput() { if (Gdx.input.isKeyJustPressed(Input.Keys.B)) { showB2DDebugRenderer = !showB2DDebugRenderer; } if (Gdx.input.isKeyJustPressed(Input.Keys.ESCAPE)) { paused = !paused; if (paused) { GameManager.getInstance().playSound("Pause.ogg"); GameManager.getInstance().pauseMusic(); } else { GameManager.getInstance().playMusic(); } } }
@Override public void render(float delta) { Klooni.theme.glClearBackground(); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(Math.min(Gdx.graphics.getDeltaTime(), minDelta)); stage.draw(); if (Gdx.input.isKeyJustPressed(Input.Keys.BACK)) { Gdx.app.exit(); } }
public void handleInput(float dt){ //control our player using immediate impulses if(player.currentState != Mario.State.DEAD) { if (Gdx.input.isKeyJustPressed(Input.Keys.UP)) player.jump(); if (Gdx.input.isKeyPressed(Input.Keys.RIGHT) && player.b2body.getLinearVelocity().x <= 2) player.b2body.applyLinearImpulse(new Vector2(0.1f, 0), player.b2body.getWorldCenter(), true); if (Gdx.input.isKeyPressed(Input.Keys.LEFT) && player.b2body.getLinearVelocity().x >= -2) player.b2body.applyLinearImpulse(new Vector2(-0.1f, 0), player.b2body.getWorldCenter(), true); if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) player.fire(); } }
@Override public void update(float deltaTime) { super.update(deltaTime); if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) { for(Entity entity:stateQueue) { StateComponent state = sm.get(entity); if (state.get() == "DEFAULT") { state.set("RUNNING"); } else { state.set("DEFAULT"); } } } stateQueue.clear(); }
public void update(float delta) { if (Gdx.input.isKeyJustPressed(Keys.SPACE)) { following = !following; } if (following) { camera.position.x = target.getPosition().x; camera.position.y = target.getPosition().y; } else { if (Gdx.input.isKeyPressed(Keys.A)) { camera.position.x -= delta * Constants.CHASE_CAM_MOVE_SPEED; } if (Gdx.input.isKeyPressed(Keys.D)) { camera.position.x += delta * Constants.CHASE_CAM_MOVE_SPEED; } if (Gdx.input.isKeyPressed(Keys.W)) { camera.position.y += delta * Constants.CHASE_CAM_MOVE_SPEED; } if (Gdx.input.isKeyPressed(Keys.S)) { camera.position.y -= delta * Constants.CHASE_CAM_MOVE_SPEED; } } } }
private void handleInput() { if (Gdx.input.isKeyJustPressed(Input.Keys.UP) && !selected) { GameManager.getInstance().playSound("Pickup.ogg"); currentSelection--; if (Gdx.input.isKeyJustPressed(Input.Keys.DOWN) && !selected) { GameManager.getInstance().playSound("Pickup.ogg"); currentSelection++; if (!selected && (Gdx.input.isKeyJustPressed(Input.Keys.X) || Gdx.input.isKeyJustPressed(Input.Keys.Z))) { GameManager.getInstance().playSound("Teleport.ogg");
@Override public void render(float delta) { Klooni.theme.glClearBackground(); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(Math.min(Gdx.graphics.getDeltaTime(), MIN_DELTA)); stage.draw(); // After everything is drawn, showcase the current shop item SnapshotArray<Actor> children = shopGroup.getChildren(); if (children.size > 0) { final ShopCard card = (ShopCard) children.get(showcaseIndex); final Batch batch = stage.getBatch(); batch.begin(); // For some really strange reason, we need to displace the particle effect // by "buyBand.height", or it will render exactly that height below where // it should. // TODO Fix this - maybe use the same project matrix as stage.draw()? // batch.setProjectionMatrix(stage.getViewport().getCamera().combined) if (!card.showcase(batch, buyBand.getHeight())) { showcaseIndex = (showcaseIndex + 1) % children.size; } batch.end(); } if (Gdx.input.isKeyJustPressed(Input.Keys.BACK)) { goBack(); } }
if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_1)) { player.powerUpAmmo(); if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_2)) { player.powerUpPower(); if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_3)) { player.powerUpSpeed(); if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_4)) { player.powerUpKick(); if (Gdx.input.isKeyJustPressed(Input.Keys.NUM_5)) { player.powerUpRemote(); if (Gdx.input.isKeyJustPressed(Input.Keys.X)) { kicking = false; if (player.kickBomb) { if (Gdx.input.isKeyJustPressed(Input.Keys.Z) && player.remoteBomb) { Queue<Entity> remoteBombQueue = GameManager.getInstance().getRemoteBombDeque();
if (Gdx.input.isKeyJustPressed(Keys.X)) { shoot();