Original Post
Hey guys, I'm currently having a lot of problems with a tile tutorial. I've been trying to split it up into separate files - the tutorial was obtained from "http://lazyfoo.net/SDL_tutorials/lesson29/index.php". I got it compiling fine but the display is far from right. I can scroll around on mine but the dot will vanish once i move off the first tile. So I'd take it the problem is that my setup for displaying the tile map is incorrect. Here's a small snippet of code I'm using for it. main.cpp tile_class.cpp As you can see it's not actually taking in a value for what tile to display. But even so I'm not sure how to setup the display as I'm pulling stuff from other files. I'm using VS 2005 with SDL and SDL Image - the full source code, images and map I've uploaded here "http://www.mediafire.com/?sharekey=3ce971b5802be32cd2db6fb9a8902bda" if anyone is willing to take a look at how i've gone wrong. I setup VS 2005 how Lazy Foo's first tutorial is setup. Any help would be a big thanks. I been working on this for a while now and on other forums but so far I'm not getting much luck. Thanks for your time, Scott.
//Show the tiles
for( int t = 0; t < TOTAL_TILES; t++ )
{
tiles[t]->show(&camera, screen, tileSheet, clips);
}
void Tile::show(SDL_Rect *pCamera, SDL_Surface *pScreen, SDL_Surface *pTileSheet, SDL_Rect pClips[])
{
if( check_collision(pCamera, &box) == true )
{
SDL_Rect offset;
//Get offsets
offset.x = box.x - pCamera->x;
offset.y = box.y - pCamera->y;
SDL_BlitSurface(pTileSheet, pClips, pScreen, &offset );
}
}