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.

C/C++ > collision detection in wraparound bg

#3626 - misehert - Sun Mar 02, 2003 1:18 pm

before I spend any more time struggling with this, is it possible to do tile collision detection for the wraparound background effect? I'm doing a simple scroll demo (sprite at center of screen) and my collision is based on tile number: i.e. if(map[bg.y_scroll/8*32+bg.x_scroll/8] != 0x00) scroll - problem, as soon as I leave the original bg and go onto the wraparound area, I lose collisions. The collision tiles are no longer being recognized.
_________________
Sorry, I'm just a Stoopid Noobie...

thank god for video x 4 - i can see again

#3627 - Lord Graga - Sun Mar 02, 2003 1:41 pm

Code:
if(bg.y_scroll==8*32) //how tall is that map in pixels?
   bg.y_scroll = 0;
if(bg.x_scroll==8*32) //how wide is that map in pixels?
   bg.y_scroll = 0;

I am sexay :)