I made this code 2 days ago for my Pacman expension game...pls tell me what u think of it
! Cheers and N_JOY
`try enterring high values like 100 for both and see what happenes
`run this program at "windowed" settings 800x600x16 for optimal performance
dim lat_pointsx(5)
dim lat_pointsy(5)
do
text screen width()/2-100,screen height()/2-40,"Corridor width: ":set cursor screen width()/2+25,screen height()/2-40:input width_cor
text screen width()/2-100,screen height()/2-26,"Corridor Height:":set cursor screen width()/2+25,screen height()/2-26:input height_cor
cls
if width_cor<>0 and height_cor<>0 then exit
loop
pctx#=10
pcty#=10
`generates the dots for the walls
do
if rnd(1) = 1 then
dot pctx#,pcty#
pctx#=pctx#+screen width()/width_cor
if pctx# > screen width()-10
pctx#=10.0
pcty#=pcty#+screen height()/height_cor
endif
if pcty# > screen height()-10 then
exit
loop
pctx#=10
pcty#=10
`makes the walls(not filled)
do
if point(pctx#,pcty#) = -1
if point(pctx#-screen width()/width_cor,pcty#) = -1
lat_pointsx(1)=pctx#-screen width()/width_cor
lat_pointsy(1)=pcty#
endif
if point(pctx#+screen width()/width_cor,pcty#) = -1
lat_pointsx(2)=pctx#+screen width()/width_cor
lat_pointsy(2)=pcty#
endif
if point(pctx#,pcty#-screen height()/height_cor) = -1
lat_pointsx(3)=pctx#
lat_pointsy(3)=pcty#-screen height()/height_cor
endif
if point(pctx#,pcty#+screen height()/height_cor) = -1
lat_pointsx(4)=pctx#
lat_pointsy(4)=pcty#+screen height()/height_cor
endif
endif
for var=1 to 4
if lat_pointsx(var)<>0 or lat_pointsy(var)<>0
line pctx#,pcty#,lat_pointsx(var),lat_pointsy(var)
lat_pointsx(var)=0 : lat_pointsy(var)=0
endif
next
pctx#=pctx#+screen width()/width_cor
if pctx#> screen width() -10
pctx#=10.0
pcty#=pcty#+screen height()/height_cor
endif
if pcty#> screen height()-10 then
exit
loop
pctx#=10
pcty#=10
`cleans the dots that remained
do
if point(pctx#,pcty#) = -1
if point(pctx#-1,pcty#)<>-1 and point(pctx#+1,pcty#)<>-1 and point(pctx#,pcty#-1)<>-1 and point(pctx#,pcty#+1)<>-1
ink rgb(0,0,0),0
dot pctx#,pcty#
endif
if point(pctx#+screen width()/width_cor,pcty#)=-1 and point(pctx#,pcty#+screen height()/height_cor)=-1 and point(pctx#+screen width()/width_cor,pcty#+screen height()/height_cor)=-1
ink rgb(255,255,255),0
box pctx#,pcty#,pctx#+screen width()/width_cor,pcty#+screen height()/height_cor
endif
endif
pctx#=pctx#+screen width()/width_cor
if pctx#> screen width()-10
pcty#=pcty#+screen height()/height_cor
if pcty#> screen height()-10 then
exit
pctx#=10.0
endif
loop
`makes the final game boarder
ink rgb(255,255,255),0
line 10,10,pctx#-screen width()/width_cor,10
line 10,10,10,pcty#-screen height()/height_cor
line pctx#-screen width()/width_cor,10,pctx#-screen width()/width_cor,pcty#-screen height()/height_cor
line 10,pcty#-screen height()/height_cor,pctx#-screen width()/width_cor,pcty#-screen height()/height_cor
wait key
Knowledge belongs to the world...but not this time