Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Map-scrolling method (long friggen post, please read)
#5
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:

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
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
B 4 EVER
Reply


Messages In This Thread
Map-scrolling method (long friggen post, please read) - by ak00ma - 09-15-2003, 02:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)