AndEngine Foreground Sprite

Posted by McGrey on Game Development See other posts from Game Development or by McGrey
Published on 2014-03-22T09:01:41Z Indexed on 2014/08/20 16:37 UTC
Read the original article Hit count: 254

Filed under:

I'm developing an Android game and have some troubles: I want to add some foreground sprites, that must obstruct my player.

Se the following example: Its a screenshot from "Shinobi 3". We can see the player, the enemy, the background and two foreground trees, that hide the player's arm and part of the enemy.

I'm using AndEngine GLES2 Anchor Center and I am trying to add a new layer to my scene.

Sprite Forest = new Sprite(getWidth() * 0.5f, textureHeightForest * 0.5f + 100, ResourcesManager.getInstance().foreground_forest_region, vbom);
Entity foregroundLayer = new Entity();
foregroundLayer.attachChild(hillFurthest);
attachChild(foregroundLayer);

But it still shows behind my player sprite. I am trying to find something in HUD-class (it's always shown in the foreground), but got no results. Can anyone help please?

© Game Development or respective owner

Related posts about andengine