so I'am currently working with the game (using libgdx) and I want to make that objects(textures) from arraylist WorldObjects which has lowest float z; to draw(render).So I need to make that game would render from lowest to highest float z;
example: 8, 8, 5, 2, 2, 2, 2, 1.4
ArrayList<WorldObject> worldObjects = new ArrayList<WorldObject>();
then this is world object class
public class WorldObject {
Texture texture;
float x, y, z;
public WorldObject(Texture texture, float x, float y, float z) {
this.texture = texture;
this.x = x;
this.y = y;
this.z = z;
}}