Skip to main content
gamedev.net
🔒 Locked

GBA: Coding Problems

Started by fusionminds 6 replies 450+ views
Original Post
fusionminds
fusionminds
Ok, you probably heard me talking about my snake game. Well I am progressing fairly well. Now, I am having trouble with the background. I have it in MODE_4, but when I do that I cannot see my sprite snake (BTW, my background is just one image). When I set it to MODE_1, I only get the sprite. Can someone help me, or point me to some correct code? Thanks.
Arek the Absolute
Arek the Absolute
Two possible problems that I see. One, check the priorities of the sprite and the background. You won''t see your sprite if it''s under the background layer. Second, one time you use a bitmap mode, the other time you don''t. In mode 4, you''re going to need to make sure your sprite''s character numbers are never lower than 512, whereas in mode 1, they can be lower. Make sure both of those are right, and see if that helps.

-Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
fusionminds
fusionminds
K, I''ll try that when I get back to school and fool around some more. It won''t be till next week. Thanks.

fusionminds
fusionminds
How do I know if the snake is under my background layer. I am currently using MODE_4. And I how do I set layers and stuff like that. Because I am having problems with seeing them both at the same time.

Arek the Absolute
Arek the Absolute
Well, in code you know by checking priorities. Lowest priorities are highest, so something with priority 0 overlaps anything with priority 1. If a sprite and a background have the same priority, the sprite overlaps the background. I assume you''re testing your ROM on an emulator as well, and those make it even easier. Most emulators (worth using, anyway) have options to turn off layers and sprites, etc. In that case all you need to do is turn off a layer to see if there''s a sprite behind it.

As far as your second question...
quote:
And I how do I set layers and stuff like that.


Well, I''m sorry but you''re going to have to rephrase that. I really don''t understand what you mean by "set layers." In mode 4, as long as you''re drawing to the screen correctly, it will show, regardless of sprites. Just keep in mind in mode 4 you only have one layer.

-Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
fusionminds
fusionminds
K, so am I going to have to just set the mode to 4. How should I have my priorities (BTW, do you mean just moving the code around, so one function is called before another?) in order? Sprite first? Background first?

I am testing it on an emulator, but I want it to work on my GBA eventually. Arek, if you have AIM, then I could talk to you a bit more. My AIM is dontRESISTcom

Thanks.

fusionminds
fusionminds
Yo, Arek

What was your AIM again? I never saved it to my buddy list. Can you IM me again, or just post it on here? Thanks.

fusionminds
fusionminds
Yes!!! I got it to work. Thanks for the help.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.