Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
It's been a while. Since the last time I visited, the wiki has been modified to the point where I can't navigate through it. So I'm asking here. I'm having a problem with sprite priority. Why does this happen? When the sprite is left, the hand covers the fly, but when it's right, it doesn't? This is driving me crazy.
Code is here:
http://www.atari2600land.com/gameboy/flies2.zip
Offline
here is a discussion: https://gbdev.gg8.se/forums/viewtopic.php?id=418
on GB it seems that nothing you can do, rather to render the correct sprite intersection manually.
Offline
ps: "rgbfix.exe -v -C flies2.gb" fixes your issue by making rom GBC-only
Offline
you may also make your "fly" a part of background, using a technique, similar to drawing "graphical" mouse in DOS textmode, using the redefinition of 4 font characters, when moving mouse cursor pixel by pixel. like in DOS "Norton Utilities 6". should I explain the method?
Offline
I was going to have a different background than just plain white.
Here is the ROM. By the way, please listen to my title screen music and let me know what you think.
http://www.atari2600land.com/gameboy/flies4.zip
Offline
chris wrote:
I was going to have a different background than just plain white.
it does not matter. here is a proof-of-concept: https://www.dropbox.com/s/eiaw6ooc7jinm … 3.zip?dl=0
this code is not optimal, I tried to make it as simple as possible, so it is very far from being called "fast". please ask, if you have questions.
it would be great, if someone can help with optimization of this code.
Offline
about the music... may be this: https://en.wikipedia.org/wiki/Flight_of_the_Bumblebee ?
Last edited by toxa (2020-02-16 15:13:05)
Offline
Thanks for trying, but I can't get it to compile on my computer. I'm not all that talented in C.
http://www.atari2600land.com/gameboy/fliesattempt.zip
Offline
neither me but I managed to make my code faster and re-usable, please download it once again: https://www.dropbox.com/s/eiaw6ooc7jinm … 3.zip?dl=0
I also added some comments to make it more readable.
Offline
ps: I think, that it is better to use arrays of pointers for animations.
pps: for masks you should leave zeros in both bit planes for transparent pixel, and both zeros for non-transparent. if you do not do so, your sprite will change color for that pixel (on one plane it is reset, on the other it is a result od OR with a bit of your background.
Offline
what's the error? what compiler version do you use?
Offline
i recommend you to use gbdk-n from here: https://github.com/andreasjhkarlsson/gbdk-n.
and a new sdcc v4.0 from here: https://sourceforge.net/projects/sdcc/f … n64/4.0.0/
Offline
I also put some bat-files to compile using sdcc4 and gbdk-n, please download the updated file again.
Offline
remove the trailing dot from the url; don't forget to build it using Make.bat
Last edited by toxa (2020-02-18 03:41:51)
Offline
you might see it without compiling, just running the *.gb from my archive anyway, it's better to use modern sdcc, it's more reliable.
Offline
throw that all away. just use a window instead of your swatter sprite. setting the sprite priority allows you to put yout sprites in front or behind the window. your case - always behind.
Last edited by toxa (2020-02-25 11:33:10)
Offline
ps: there is even an exelent example already: https://gbdev.gg8.se/forums/viewtopic.php?id=620
Offline