예제 #1
0
  private void renderOrbs(OrbPart orbPart) {
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

    shapeRenderer.setProjectionMatrix(camera.combined);
    shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);

    float orbRadius = 0f;

    for (Orb orb : orbs) {
      if (orbPart == OrbPart.Light) {
        orb.setColor(orb.LIGHT_COLOR);
        orbRadius = orb.getRadius() * 1.2f;
      } else if (orbPart == OrbPart.Dark) {
        orb.setColor(orb.DARK_COLOR);
        orbRadius = orb.getRadius();
      }
      shapeRenderer.setColor(orb.getColor());
      shapeRenderer.circle(orb.getPosition().x, orb.getPosition().y, orbRadius);
    }
    shapeRenderer.end();
  }
예제 #2
0
 private void updateOrbs(float delta) {
   for (Orb orb : orbs) {
     orb.update(delta);
   }
 }