This drawing way will draw to the screen only what is require. Say you have a map that is 5000,5000 sprites/images, it will take while to load it over and over again if it is that big. This alogrithm will only draw only what is needed to the screen. So your game/program will draw the level in segments and not as whole as some games do.
-Alogrithm-
segy=0
segx=0
movey=50
movex=50
do
cls
for g=1 to 12
for b=1 to 15
if lvl(b+segx,g+segy)=1
paste image 2,x+movex-50,y+movey-50
endif
x=x+50
next b
x=0
y=y+50
next g
y=0
loop
Example code that uses it
Rem Project: cool
Rem Created: 11/29/2004 3:13:49 PM
Rem ***** Main Source File *****
set display mode 640,480,16
ink rgb(0,200,25),1
box 0,0,50,50
get image 1,0,0,50,50
cls
ink rgb(0,25,200),1
box 0,0,50,50
get image 2,0,0,50,50
cls
red:
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9
ink rgb(255,255,255),1
a=0
count=0
ycount=1
checky=1
while a<>9
print str$(checky) + "-";
while a<8 or a>9
read a
if a<>8 and a<>9
count=count+1
print str$(a);
endif
endwhile
if a<>9
ycount=ycount+1
print
checky=checky+1
endif
if a=8
a=0
count = 0
endif
endwhile
cls
dim lvl(count,ycount)
restore red
a=0
count=0
ycount=1
while a<>9
while a<8 or a>9
read a
if a<>8 and a<>9
count=count+1
if a=1 then lvl(count,ycount)=1
if a=0 then lvl(count,ycount)=0
endif
endwhile
if a<>9
ycount=ycount+1
endif
if a=8
a=0
count = 0
endif
endwhile
print "Done"
print "x-";:print count
print "y-";:print ycount
for g=1 to 26
for b=1 to 35
print str$(lvl(b,g));
next b
print
next g
suspend for key
cls
segy=0
segx=0
movey=50
movex=50
do
cls
for g=1 to 12
for b=1 to 15
if lvl(b+segx,g+segy)=1
paste image 2,x+movex-50,y+movey-50
endif
x=x+50
next b
x=0
y=y+50
next g
y=0
if rightkey()=1
if movex<=-50
movex=0
segx=segx+1
endif
movex=movex-2
endif
if leftkey()=1
if movex>=50
movex=0
segx=segx-1
endif
movex=movex+2
endif
if downkey()=1
if movey<=-50
movey=0
segy=segy+1
endif
movey=movey-2
endif
if upkey()=1
if movey>=50
movey=0
segy=segy-1
endif
movey=movey+2
endif
loop
TO DENY MY WISDOM FOR ANGER
TO BREAK THE SCREAM OF THE SILENT FOOL
TO BE A KNIGHTRIDER OF DOOM... OF DOOM!