   Drawing tiles around the player
  Im making a tile based game, something like pokemon on the gameboy and if tun into a problem.If my map is bigger then the amount of tiles that fit onto the screen i want it to scroll until it cant anymore and then I want the player to move. Also when the map is smaller then the screen I want the world to appear in the middel and the world to not scroll at all.How would I do something like that?   
  use if statementsif player.x < screenwidth//draw as if player is on the left side of the screenelse if player.x > map.width-screenwidth//draw as if player is on the right side of the screenelse//draw as player is in the middleif player.y < screenheight//draw as if player is on the top of the screenelse if player.y > map.height-screenheight//draw as if player is on the right side of the screenelse//draw as player is in the middleadd more conditions as necessary   ;  Once you got that, read this to see how to do smooth scrolling.   