At the moment i have almost finished this code is quite good and i am planning to add media later on but at the moment I am stuck on Make Light System - It doesn't make LightBasicSys.dat file??? Could someone please look through the bottom of this code and tell me what is wrong,thanks
menu:
cls
print "Welcome to Light Basic Me version"
print "Would you like to :"
print "1)Make/Read a document"
print "2)Listen to Music"
print "3)Play a game"
print "4)Make Light System"
input a$
if a$="1" then goto lb_doc
if a$="2" then goto lb_music
if a$="3" then goto lb_game
if a$="4" then goto lb_sys
goto menu
lb_doc:
cls
print "This is Light Basic's Document maker/reader"
print "1)write"
print "2)read"
print "3)back"
input b$
if b$="1" then goto lbd_lbd
if b$="2" then goto lbd_read
if b$="3" then goto menu
goto lb_doc
lbd_lbd:
cls
print "Enter your 10 lines here"
input c$
input d$
input e$
input f$
input g$
input h$
input i$
input j$
input k$
input l$
print "Enter Directory:"
wait 1500
input aa$
set dir aa$
print "Enter filename:"
input m$
delete file m$
open to write 1,m$
write string 1,c$
write string 1,d$
write string 1,e$
write string 1,f$
write string 1,g$
write string 1,h$
write string 1,i$
write string 1,j$
write string 1,k$
write string 1,l$
close file 1
print "Done"
wait 2000
goto lb_doc
lbd_read:
cls
print "Enter Directory:"
wait 1500
input aa$
set dir aa$
print "Enter filename:"
input m$
open to read 1,m$
read string 1,c$
read string 1,d$
read string 1,e$
read string 1,f$
read string 1,g$
read string 1,h$
read string 1,i$
read string 1,j$
read string 1,k$
read string 1,l$
print c$
print d$
print e$
print f$
print g$
print h$
print i$
print j$
print k$
print l$
wait key
close file 1
goto lb_doc
lb_music:
cls
print "Enter one option"
print "1)Play"
print "2)Back"
input a$
if a$="1" then goto lbm_play
if a$="2" then goto menu
goto lb_music
lbm_play:
cls
input "Enter Dir: ",a$
set dir a$
input "Enter Filename: ",a$
load music a$,1
play music 1
print "Press n key to return and stop music"
print "Press m key to return and play music"
input a$
if a$="n" then stop music 1 : goto lb_music
if a$="m" then goto lb_music
goto lbm_play
lb_game:
cls
print "Once playng press esc to exit"
print "1)Pong"
print "2)Back"
input a$
if a$="1" then goto lbg_pong
if a$="2" then goto menu
goto lb_game
lbg_pong:
rem HIDE THE MOUSE AND LIMIT THE SYNC RATE TO 40
hide mouse:sync rate 40
rem MAKE THE PADDLES, BALL AND FLOOR
make object box 1,1,1,3:color object 1,rgb(255,0,0)
make object box 2,1,1,3:color object 2,rgb(0,255,0)
make object sphere 3,1:color object 3,rgb(0,0,50)
make object box 4,10,0.1,10:position object 4,0,-0.55,0
rem SET THE BALL ANGLE TO 90 DEGREES
balla#=90
rem START THE MAIN LOOP
sync on:do
rem SCORING
if ballx#>6 then player2score#=player2score#+1:ballx#=0:ballz#=0:balla#=270
if ballx#<-6 then player1score#=player1score#+1:ballx#=0:ballz#=0:balla#=90
set cursor 300,50:print player2score#
set cursor 320,50:print "-"
set cursor 340,50:print player1score#
rem BALL MOVEMENT
ballx#=newxvalue(ballx#,balla#,0.3):ballz#=newzvalue(ballz#,balla#,0.3)
rem PLAYER 1 PADDLE MOVEMENT
IF upkey()=1 and player1pos#<3.5 then player1pos#=player1pos#+0.5
IF downkey()=1 and player1pos#>-3.5 then player1pos#=player1pos#-0.5
if upkey()=1 and ballx#>4 and ballx#<4.5 then balla#=balla#+8
if downkey()=1 and ballx#>4 and ballx#<4.5 then balla#=balla#-8
rem PLAYER 2 PADDLE MOVEMENT
IF keystate(17)=1 and player2pos#<3.5 then player2pos#=player2pos#+0.5
IF keystate(31)=1 and player2pos#>-3.5 then player2pos#=player2pos#-0.5
if keystate(17)=1 and ballx#<-4 and ballx#>-4.5 then balla#=balla#+8
if keystate(31)=1 and ballx#<-4 and ballx#>-4.5 then balla#=balla#-8
rem BOUNCING
if ballx#>4 and ballx#<4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#<-4 and ballx#>-4.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#
if ballz#>4 or ballz#<-4 then balla#=180-balla#
rem MAKE SURE balla# IS LESS THAN 360 AND MORE THAN 0
balla#=wrapvalue(balla#)
rem POSITION OBJECTS
position object 1,5,0,player1pos#:position object 2,-5,0,player2pos#
position object 3,ballx#,0,ballz#:yrotate object 3,balla#
position camera 0,10,-10:point camera 0,0,0
sync:loop
lb_sys:
cls
print "1)Add new Directory"
print "2)Add new File"
print "3)Look at Light Basic Me system"
print "4)Back"
input a$
if a$="1" then goto lbsys_dir
if a$="2" then goto lbsys_file
if a$="3" then goto lbsys_sys
if a$="4" then goto menu
goto lb_sys
lbsys_dir:
cls
input "Add directory name: ",a$
goto control_sys_dr
lbsys_file:
cls
input "Add file name: ",a$
goto control_sys_fl
lbsys_sys:
set dir "c:\"
if file exist("LightBasicsys.dat") then goto a
print "No Light System set"
wait 1500
goto lb_sys
a:
open to read 1,"LightBasicsys.dat"
read string 1,q$
read string 1,w$
read string 1,e$
read string 1,r$
read string 1,t$
read string 1,y$
read string 1,u$
read string 1,i$
read string 1,o$
read string 1,p$
read string 1,qa$
read string 1,wa$
read string 1,ea$
read string 1,ra$
read string 1,ta$
read string 1,ya$
read string 1,ua$
read string 1,ia$
read string 1,oa$
read string 1,pa$
read string 1,qaa$
read string 1,waa$
read string 1,eaa$
read string 1,raa$
read string 1,taa$
read string 1,yaa$
read string 1,uaa$
read string 1,iaa$
read string 1,oaa$
read string 1,paa$
print "Current Drives:"
if q$="-" then print q$
if w$="-" then print w$
if e$="-" then print e$
if r$="-" then print r$
if t$="-" then print t$
if y$="-" then print y$
if u$="-" then print u$
if i$="-" then print i$
if o$="-" then print o$
if p$="-" then print p$
if qa$="-" then print qa$
if wa$="-" then print wa$
if ea$="-" then print ea$
if ra$="-" then print ra$
if ta$="-" then print ta$
if ya$="-" then print ya$
if ua$="-" then print ua$
if ia$="-" then print ia$
if oa$="-" then print oa$
if pa$="-" then print pa$
if qaa$="-" then print qaa$
if waa$="-" then print waa$
if eaa$="-" then print eaa$
if raa$="-" then print raa$
if taa$="-" then print taa$
if yaa$="-" then print yaa$
if uaa$="-" then print uaa$
if iaa$="-" then print iaa$
if oaa$="-" then print oaa$
if paa$="-" then print paa$
print ""
print "Current Files:"
if q$="+" then print q$
if w$="+" then print w$
if e$="+" then print e$
if r$="+" then print r$
if t$="+" then print t$
if y$="+" then print y$
if u$="+" then print u$
if i$="+" then print i$
if o$="+" then print o$
if p$="+" then print p$
if qa$="+" then print qa$
if wa$="+" then print wa$
if ea$="+" then print ea$
if ra$="+" then print ra$
if ta$="+" then print ta$
if ya$="+" then print ya$
if ua$="+" then print ua$
if ia$="+" then print ia$
if oa$="+" then print oa$
if pa$="+" then print pa$
if qaa$="+" then print qaa$
if waa$="+" then print waa$
if eaa$="+" then print eaa$
if raa$="+" then print raa$
if taa$="+" then print taa$
if yaa$="+" then print yaa$
if uaa$="+" then print uaa$
if iaa$="+" then print iaa$
if oaa$="+" then print oaa$
if paa$="+" then print paa$
WAIT KEY
close file 1
goto lb_sys
control_sys_dr:
set dir "c:\"
if file exist("LightBasicsys.dat")
open to read 1,"LightBasicsys.dat"
read string 1,q$
read string 1,w$
read string 1,e$
read string 1,r$
read string 1,t$
read string 1,y$
read string 1,u$
read string 1,i$
read string 1,o$
read string 1,p$
read string 1,qa$
read string 1,wa$
read string 1,ea$
read string 1,ra$
read string 1,ta$
read string 1,ya$
read string 1,ua$
read string 1,ia$
read string 1,oa$
read string 1,pa$
read string 1,qaa$
read string 1,waa$
read string 1,eaa$
read string 1,raa$
read string 1,taa$
read string 1,yaa$
read string 1,uaa$
read string 1,iaa$
read string 1,oaa$
read string 1,paa$
close file 1
delete file "LightBasicsys.dat"
open to write 1,"LightBasicsys.dat"
if q$<>"" then write string 1,q$
if w$<>"" then write string 1,w$
if e$<>"" then write string 1,e$
if r$<>"" then write string 1,r$
if t$<>"" then write string 1,t$
if y$<>"" then write string 1,y$
if u$<>"" then write string 1,u$
if i$<>"" then write string 1,i$
if o$<>"" then write string 1,o$
if p$<>"" then write string 1,p$
if qa$<>"" then write string 1,qa$
if wa$<>"" then write string 1,wa$
if ea$<>"" then write string 1,ea$
if ra$<>"" then write string 1,ra$
if ta$<>"" then write string 1,ta$
if ya$<>"" then write string 1,ya$
if ua$<>"" then write string 1,ua$
if ia$<>"" then write string 1,ia$
if oa$<>"" then write string 1,oa$
if pa$<>"" then write string 1,pa$
if qaa$<>"" then write string 1,qaa$
if waa$<>"" then write string 1,waa$
if eaa$<>"" then write string 1,eaa$
if raa$<>"" then write string 1,raa$
if taa$<>"" then write string 1,taa$
if yaa$<>"" then write string 1,yaa$
if uaa$<>"" then write string 1,uaa$
if iaa$<>"" then write string 1,iaa$
if oaa$<>"" then write string 1,oaa$
if paa$<>"" then write string 1,paa$
write string 1,"-"+a$
close file 1
endif : goto lb_sys
open to write 1,"LightBasicsys.dat"
write string 1,"-"+a$
close file 1
goto lb_sys
control_sys_fl:
set dir "c:\"
if file exist("LightBasicsys.dat")
open to read 1,"LightBasicsys.dat"
read string 1,q$
read string 1,w$
read string 1,e$
read string 1,r$
read string 1,t$
read string 1,y$
read string 1,u$
read string 1,i$
read string 1,o$
read string 1,p$
read string 1,qa$
read string 1,wa$
read string 1,ea$
read string 1,ra$
read string 1,ta$
read string 1,ya$
read string 1,ua$
read string 1,ia$
read string 1,oa$
read string 1,pa$
read string 1,qaa$
read string 1,waa$
read string 1,eaa$
read string 1,raa$
read string 1,taa$
read string 1,yaa$
read string 1,uaa$
read string 1,iaa$
read string 1,oaa$
read string 1,paa$
close file 1
delete file "LightBasicsys.dat"
open to write 1,"LightBasicsys.dat"
if q$<>"" then write string 1,q$
if w$<>"" then write string 1,w$
if e$<>"" then write string 1,e$
if r$<>"" then write string 1,r$
if t$<>"" then write string 1,t$
if y$<>"" then write string 1,y$
if u$<>"" then write string 1,u$
if i$<>"" then write string 1,i$
if o$<>"" then write string 1,o$
if p$<>"" then write string 1,p$
if qa$<>"" then write string 1,qa$
if wa$<>"" then write string 1,wa$
if ea$<>"" then write string 1,ea$
if ra$<>"" then write string 1,ra$
if ta$<>"" then write string 1,ta$
if ya$<>"" then write string 1,ya$
if ua$<>"" then write string 1,ua$
if ia$<>"" then write string 1,ia$
if oa$<>"" then write string 1,oa$
if pa$<>"" then write string 1,pa$
if qaa$<>"" then write string 1,qaa$
if waa$<>"" then write string 1,waa$
if eaa$<>"" then write string 1,eaa$
if raa$<>"" then write string 1,raa$
if taa$<>"" then write string 1,taa$
if yaa$<>"" then write string 1,yaa$
if uaa$<>"" then write string 1,uaa$
if iaa$<>"" then write string 1,iaa$
if oaa$<>"" then write string 1,oaa$
if paa$<>"" then write string 1,paa$
write string 1,"+"+a$
close file 1
endif : goto lb_sys
open to write 1,"LightBasicsys.dat"
write string 1,"+"+a$
close file 1
goto lb_sys
Think Before You Post!