Back to project page acceptableLosses.
The source code is released under:
MIT License
If you think the Android project acceptableLosses listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package acceptableLosses.systems; /*from w w w .j ava 2 s . com*/ import acceptableLosses.map.Region; import acceptableLosses.screens.GameScreen; import com.artemis.systems.VoidEntitySystem; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; /** * This system controls the floor we are looking at. */ public class ElevationSystem extends VoidEntitySystem { private GameScreen gameScreen; private Region region; public ElevationSystem(GameScreen gameScreen, Region region) { this.gameScreen = gameScreen; this.region = region; } @Override protected void processSystem() { if (Gdx.input.isKeyJustPressed(Input.Keys.COMMA)) { gameScreen.zLevel = Math.min(gameScreen.zLevel + 1, region.zSize - 1); } else if (Gdx.input.isKeyJustPressed(Input.Keys.PERIOD)) { gameScreen.zLevel = Math.max(gameScreen.zLevel - 1, 0); } } }