// GameManager.java public class GameManager private Context context; private SharedPreferences prefs; private static final String PREFS_NAME = "GamePrefs"; public GameManager(Context context) this.context = context; prefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
private void controlFPS() try Thread.sleep(17); // ~60 FPS catch (InterruptedException e) e.printStackTrace(); juegos para android version 4.1.2
@Override public void render(float delta) Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Handle input if (Gdx.input.isTouched()) playerPosition.set(Gdx.input.getX(), Gdx.input.getY()); // Draw batch.begin(); batch.draw(playerTexture, playerPosition.x, playerPosition.y); batch.end(); // GameManager