Пример #1
0
 @Override
 public void dispose() {
   // Renderable.dispose
   for (Renderable r : renderables) {
     r.dispose();
   }
 }
Пример #2
0
  @Override
  public void render(float delta) {
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    camera.update();
    mainGame.spriteBatch.setProjectionMatrix(camera.combined);

    world.step(1 / 45f, 6, 2);

    // Renderable.update
    for (Renderable r : renderables) {
      r.update();
    }

    if (Gdx.input.isTouched()) {
      Gdx.app.debug(TAG, "Fire");
    }

    mainGame.spriteBatch.begin();

    // Renderable.render
    for (Renderable r : renderables) {
      r.render(mainGame.spriteBatch);
    }

    mainGame.spriteBatch.end();
  }