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.
Hi all,
I recently started a platform/action game for Game Boy with GBDK. Right now I'm working on the background scrolling.
The way I do this is the following.
The map is an array of characters representing 8x8 tiles. When as a result of the scroll the end of the background data is reached, the background data is reloaded using as index the displacement performed so far (the scroll is one way only).
For some reason I do not understand I am forced to do a reverse scroll with the displacement performed since the previous map loading before loading the map again. Otherwise, the map is loaded with scroll included. As a result, the method is as follows:
void loadmap(int scrlx) {
scroll_bkg(-scrlx);
set_bkg_tiles(0, 0, MTESTWIDTH, MTESTHEIGHT, &mtest[scrlx/8]);
}
The problem here is that making this reverse scroll causes a flicker, showing the background with the mentioned scroll applied for an instant, and I'd be interested to know what options I have to make the scroll correctly.
The truth is I have not been able to find much information about game development with GBDK and I would be very grateful if you could help me.
If you you detect some lexical irregularities in the text I'm sorry. English is not my native language.
Last edited by Imanolea (2014-05-17 16:13:42)
Offline
You can try to hide the background before loading your map and show it again when loading is done.
void loadmap(int scrlx)
{
HIDE_BKG;
scroll_bkg(-scrlx);
set_bkg_tiles(0, 0, MTESTWIDTH, MTESTHEIGHT, &mtest[scrlx/8]);
SHOW_BKG;
}
It generally prevents flickering.
Offline