Items Rendering Behind Map Layers?

Hey all! I’ve encountered an odd issue whereby the items I have spawned in the game world seem to be rendering behind the game map itself, despite their render calls taking place after the OrthogonalTiledMapRenderer I’m using. I took the SuperKoalio example as a foundation for the platforming code but changed it to fit more of an Entity-Component model, then added a List of what I’ve named ItemDrops that have physics and are supposed to render just a layer behind the player. However, they end up rendering behind any of the map layers as well, and when I jump, they seem to rise up and down a little bit, as if there is some sort of parallax effect involved; I don’t know if the OrthogonalTiledMapRenderer does anything like that. They’re using the same SpriteBatch as the player and the renderer. The higher-level flow is like the following, within my render method:


Gdx.gl.glClearColor(0.7f, 0.7f, 1.0f, 1);
Gdx.gl.glClear(GL10.COLOR_BUFFER_BIT);

// updates their position, applies gravity, etc.
level.updateEntities(delta);
player.update(delta);

// let the camera follow the player
camera.position.x = player.position.x;
camera.position.y = player.position.y;
camera.update();

// set the tile map renderer view based on what the camera sees and render the map
renderer.setView(camera);
renderer.render();
level.renderEntities();
player.render();

Render calls to the player and the entities are basically just acquiring the SpriteBatch from the same renderer as shown here and calling the needed batch.begin() and .end() calls, drawing the needed frames, and that’s it. The ItemDrop objects mentioned previously are updated and rendered in level.updateEntities(delta) and level.renderEntities(), successfully; the List resides within the Level object. Help is greatly appreciated! Willing to supply any code needed, but there’s quite a bit at this point; don’t want to bog down the post too much! Hoping the issue is something simple I don’t know about SpriteBatches or OrthogonalTiledMapRenderers! ;]

Colton