Reading tiles on map
Posted: Sat May 24, 2014 12:55 pm
I have a 512x512 background inited with:
And am then trying to get the tiles so I can write a collision system for a game.
Although this function returns values which are in my map, it returns the wrong ones.
Code: Select all
int id = bgInit(0, BgType_Text8bpp, BgSize_T_512x512, 28, 0);
Code: Select all
inline u16 getTile(int id, int x, int y) {
return bgGetMapPtr(id)[y * (512 / 8) + x];
}