Think of a 640x480 screen divided into 32x32 tiles, gives you 20 across and 15 down. So every frame you're drawing each tile. It's slightly slower to draw every tile, every frame, but it's the way I've been doing it for years and never really had any problems.
In my MGE game engine, it has a fully functional tile engine that allows you to scroll any direction, multiple layers for parallax scrolling, etc, etc. To scroll around I just draw the tile map offset by x,y pixels. I also draw an extra row/column on the sides to compensate for the scrolled area. I only draw the section of the tile map that's visible. Sprites live inside the tile map, so if the map x,y changes the sprites automatically are updated. To keep the sprite in the middle I just subtract half the screen width/height from the sprite's position and make that the tile map top left x,y.
Here's a basic demo of the tile engine:
http://blitzmax-2d-game-engine.blogspot.com/2007_08_01_archive.html
I'm just not getting back into coding my game engine, I should have more details in the coming weeks. ;)
In my MGE game engine, it has a fully functional tile engine that allows you to scroll any direction, multiple layers for parallax scrolling, etc, etc. To scroll around I just draw the tile map offset by x,y pixels. I also draw an extra row/column on the sides to compensate for the scrolled area. I only draw the section of the tile map that's visible. Sprites live inside the tile map, so if the map x,y changes the sprites automatically are updated. To keep the sprite in the middle I just subtract half the screen width/height from the sprite's position and make that the tile map top left x,y.
Here's a basic demo of the tile engine:
http://blitzmax-2d-game-engine.blogspot.com/2007_08_01_archive.html
I'm just not getting back into coding my game engine, I should have more details in the coming weeks. ;)