09-15-2003, 02:44 PM
Just make your DC as big as your screen (320x200 for example). When your map doesn't fit in one piece on the screen it is ok, because you only need to draw the currently visible part of the map (so the speed will increase because less things will be drawn).
Just make it likes this:
That's a simple tile by tile scroller, but you must add only a few things to make it a real pixel by pixel scroller
Just make it likes this:
Code:
cam.xpos = 0 'upper left corner of the screen (x-coordinate)
cam.ypos = 0 'upper left corner of the screen (y-coordinate)
cam.xwide = 20 'how many tiles in every row
cam.ywide = 15 'how many tiles in every column
tile.xwide = 20
tile.ywide = 20
FOR nx = cam.xpos TO cam.xpos + cam.xwide
FOR ny = cam.ypos TO cam.ypos + cam.ywide
gx = tile.xwide * (nx - cam.xpos)
gy = tile.ywide * (ny - cam.ypos)
PUT (gx, gy), tile
NEXT ny
NEXT nx
B 4 EVER