Re: Game Image Layering Help
Is this a top down orthographic or a 2D sidescroller? I don't know if I can help you (do most of my games programming in C++) but the order in which you render the sprites on screen relates to which one is on top. The last one you draw will draw over the other ones. Try putting the player.tick line before the eman. If you need one in front of the other based on certain conditions just create a boolean and an if.
Code Java:
if (playerInFront) {
player.tick(g,screenWidth,screenHeight,screenX, screenY, this);
eman.tick(g, player, screenX, screenY, map);
else {
eman.tick(g, player, screenX, screenY, map);
player.tick(g,screenWidth,screenHeight,screenX, screenY, this);
}
Oh, and try to use the highlight tag around code. It makes it easier for us to read and help you.
Re: Game Image Layering Help
Quote:
Originally Posted by
ChristopherLowe
Is this a top down orthographic or a 2D sidescroller? I don't know if I can help you (do most of my games programming in C++) but the order in which you render the sprites on screen relates to which one is on top. The last one you draw will draw over the other ones. Try putting the
player.tick line before the
eman. If you need one in front of the other based on certain conditions just create a boolean and an if.
Code Java:
if (playerInFront) {
player.tick(g,screenWidth,screenHeight,screenX, screenY, this);
eman.tick(g, player, screenX, screenY, map);
else {
eman.tick(g, player, screenX, screenY, map);
player.tick(g,screenWidth,screenHeight,screenX, screenY, this);
}
Oh, and try to use the
highlight tag around code. It makes it easier for us to read and help you.
That looks like it'll work! Thanks man. I appreciate it!
Oh, and it's Top Down, Like pokemon, or the retro Final Fantasies.
EDIT!
Actually, no that wouldn't haha.
eman is the Entity Manager, which manages numerous entities.
Essentially, Imagine the player between two vertically parallel NPCs.
Re: Game Image Layering Help
Quote:
Originally Posted by
SkyAphid
EDIT!
Actually, no that wouldn't haha.
eman is the Entity Manager, which manages numerous entities.
Essentially, Imagine the player between two vertically parallel NPCs.
In that case you will need to redesign to get what you want. One cheap and quick option may be to pass the player object into your entity manager as a parameter and then gig things around in eman.tick so the player gets drawn where you want. Without looking at how you designed your game it is kind of difficult to know how to advise you, this suggestion may be way off.
Actually, I am not entirely sure what the problem is now. Perhaps you could provide a screenshot? If it a top down, then won't the player ALWAYS be on top?