gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > priorities

#9629 - jenswa - Mon Aug 11, 2003 6:38 pm

The sprites on the gba, only has 4 (0,1,2 and 3) priorities,
is that right? Or i am missing something.

I have a snake of 10 blocks long (in iso) and in some directions,
i need to have the last block above the first block, so i tried
to switch all priorities, but that didn't came far, since there are
only 4 allowed (i experienced, with vboy, didn't test it on hardware yet).

So the only other option i see, is swapping the positions of the blocks
and lower priorities of the ones that don't need to be on top.

Or do you have any other suggestion, that does the same?
_________________
It seems this wasn't lost after all.

#9630 - niltsair - Mon Aug 11, 2003 6:57 pm

Sprites have 2 priorities you can use.

The first one is the one you mentionned, you pick between 0-3 and that set on top of what background & sprites it'll be showed.

The second one is when 2 sprites have the same background priority and overlap. The sprite having the highter(i think, might be opposite) OAM number will be showed on top of the other one.

#9631 - jenswa - Mon Aug 11, 2003 7:08 pm

Jep that's right.

I've my little demo, running with four sprites,
but with ten i cannot goto priority ten.

http://www.geocities.com/awsnej/iso-snake.zip
_________________
It seems this wasn't lost after all.

#9638 - tepples - Mon Aug 11, 2003 9:25 pm

The sprite's "priority" value is used only for which backgrounds cover the sprite. If you want to put sprites in front of sprites, put the front sprites first in OAM. This applies to at least NES and GBA. (On GB/GBC, the sprite on the left would always be in front.)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9674 - jenswa - Wed Aug 13, 2003 3:52 pm

Go it fixed,

just sorting all y positions, so one block is in front
of another
_________________
It seems this wasn't lost after all.