@Override public void render(SpriteBatch sb) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); sb.setProjectionMatrix(cam.combined); sb.begin(); // Determine what to render based on score { if (score <= 3) { sb.draw(bg2, cam.position.x - (cam.viewportWidth / 2), 0); sb.draw(bird.getTexture(score), bird.getPosition().x, bird.getPosition().y); } else if (score <= 6) { sb.draw(bg, cam.position.x - (cam.viewportWidth / 2), 0); sb.draw(bird.getTexture(score), bird.getPosition().x, bird.getPosition().y); } else if (score <= 9) { sb.draw(android_bg, cam.position.x - (cam.viewportWidth / 2), 0); sb.draw(bird.getTexture(score), bird.getPosition().x, bird.getPosition().y); } else if (score > 9) { sb.draw(cob_bg, cam.position.x - (cam.viewportWidth / 2), 0); sb.draw(bird.getTexture(score), bird.getPosition().x, bird.getPosition().y); } // pass score to tube to determine what to render for (Tube tube : tubes) { sb.draw(tube.getTopTube(score), tube.getPosTopTube().x, tube.getPosTopTube().y); sb.draw(tube.getBottomTube(score), tube.getPosBotTube().x, tube.getPosBotTube().y); } // determine what ground to render based on current score if (score <= 3) { sb.draw(ground, groundPos1.x, groundPos1.y); sb.draw(ground, groundPos2.x, groundPos2.y); } else if (score <= 6) { sb.draw(ground2, groundPos1.x, groundPos1.y); sb.draw(ground2, groundPos2.x, groundPos2.y); } else if (score <= 9) { sb.draw(ground3, groundPos1.x, groundPos1.y); sb.draw(ground3, groundPos2.x, groundPos2.y); } else if (score > 9) { sb.draw(ground4, groundPos1.x, groundPos1.y); sb.draw(ground4, groundPos2.x, groundPos2.y); } } sb.end(); sb.begin(); // Write score to screen font.setColor(Color.WHITE); font.draw(sb, String.format("%.0f", score), scoreX, scoreY); sb.end(); }