   Bounds checking tile engine
  Playing around with a smooth scrolling tile engine and having a bit of a round with the bounds checking.  I got something that works but it doesn't seem like it would be right.  I checked it with a couple different sized maps and it stopped correctly just thinking there has to be a better way.if (keys[VK_DOWN]) {keys[VK_DOWN]=FALSE;if (map_yoffset < (map_height - (display_y-2)) * TILE_HEIGHT - (TILE_HEIGHT/2) + MOVE_SIZE)map_yoffset += MOVE_SIZE;}if (keys[VK_RIGHT]) {keys[VK_RIGHT]=FALSE;   if (map_xoffset < (map_width - (display_x-2)) * TILE_WIDTH - (TILE_WIDTH/2))map_xoffset += MOVE_SIZE;}I've got the minus two because I need the one extra for the partial tiles then the other is because OpenGL likes pop in a line of tiles so I just render the extra off screen and let it scroll in.   
  Thanks for the usual amount of help I get from this place.  Guess I have no reason to waste my time coming here anymore.   ;  it usually takes a little while before someone replies, if you give up that easily i hate to see what you can accomplish when things get really tough.as far as the code, it looks ok, and if it works why mess with a godo thing?   ;  The way you're doing it is fine.  Nice to see you apparently don't appreciate the free help you get here.  Ingrate.   ;Quote:Original post by KazgorothNice to see you apparently don't appreciate the free help you get here.  Ingrate.bahaha, i almost spit out my iced tea. dont know why but that ingrate comment just hit the right spot