use of net.catacombsnatch.game.scene.Scene in project Catacomb-Snatch by Catacomb-Snatch.
the class InputManager method keyUp.
@Override
public boolean keyUp(int keycode) {
Scene scene = SceneManager.getCurrent();
if (scene != null)
scene.keyUp(keycode);
InputSource source = InputSource.KEYBOARD;
Key key = getKeyForSource(source, keycode, null);
pressed.put(key, false);
KeyReleaseEvent event = new KeyReleaseEvent(source, key, null);
EventManager.callEvent(event);
return true;
}
use of net.catacombsnatch.game.scene.Scene in project Catacomb-Snatch by Catacomb-Snatch.
the class InputManager method keyTyped.
@Override
public boolean keyTyped(char character) {
Scene scene = SceneManager.getCurrent();
if (scene != null)
scene.keyTyped(character);
KeyTypeEvent event = new KeyTypeEvent(InputSource.KEYBOARD, character);
EventManager.callEvent(event);
return true;
}
use of net.catacombsnatch.game.scene.Scene in project Catacomb-Snatch by Catacomb-Snatch.
the class InputManager method keyDown.
/* -------- Keyboard and Mouse input events -------- */
@Override
public boolean keyDown(int keycode) {
Scene scene = SceneManager.getCurrent();
if (scene != null)
scene.keyDown(keycode);
InputSource source = InputSource.KEYBOARD;
Key key = getKeyForSource(source, keycode, null);
pressed.put(key, true);
KeyPressedEvent event = new KeyPressedEvent(source, key, null);
EventManager.callEvent(event);
return true;
}
use of net.catacombsnatch.game.scene.Scene in project Catacomb-Snatch by Catacomb-Snatch.
the class CatacombSnatch method render.
@Override
public void render() {
Screen.clear();
Scene last = null;
if (SceneManager.isDrawAllEnabled()) {
for (Scene scene : sceneManager.getScenes()) {
if (scene.hasBeenClosed())
continue;
scene.tick(Gdx.graphics.getDeltaTime());
scene.getBatch().end();
last = scene;
}
} else {
last = SceneManager.getCurrent();
if (last != null) {
last.tick(Gdx.graphics.getDeltaTime());
last.getBatch().end();
}
}
if (last != null && (Boolean) DefaultOptions.DEBUG.get()) {
Monitoring.update("fps", Gdx.graphics.getFramesPerSecond());
Monitoring.render(last.getBatch());
}
}
Aggregations