please help me, I am making a game and in my options menu everytime I change this I have to use cls, but I have to let go of the key to make it show the screen again. here is my source code.
rem options menu
options:
if file exist("options.dat") = 1
exist(1) = 1
open to read 1, "options.dat"
read long 1, volume#
read long 1, sfx#
close file 1
else
exist(1)=0
volume#=50
sfx#=50
endif
selection# = 1
ink rgb(255,255,255),rgb(128,64,0)
cls
sync rate 20
do
volume$=str$(volume#)
sfx$=str$(sfx#)
white = rgb(255,255,255)
brown = rgb(128,64,0)
blue = rgb(0,128,255)
ink white,brown
set cursor 0,0
set text to bolditalic
Text 0,0,"Options"
set text to normal
if selection# = 1 then ink blue, brown
text 0,50,"music volume"
text 540,50,volume$
ink white, brown
if selection# = 2 then ink blue, brown
text 0,80,"sound effects volume:"
text 540,80,sfx$
volume# = val(volume$)
sfx# = val(sfx$)
rem selections
if downkey()=1 then dec selection#
if upkey()=1 then inc selection#
if selection#>2 then selection# = 1
if selection#<1 then selection# = 2
if leftkey() = 1 and selection# = 1
dec volume#
cls
endif
if rightkey() = 1 and selection# = 1
inc volume#
cls
endif
if leftkey() = 1 and selection# = 2
dec sfx#
cls
endif
if rightkey() = 1 and selection# = 2
inc sfx#
cls
endif
if volume#>100
volume#=100
cls
endif
if volume#<0
volume#=0
cls
endif
if sfx#>100 then sfx#=100
if sfx#<0 then sfx#=0
set cursor 0, 380
ink white, brown
set text to italic
print "press enter to save changes and exit"
print "press space bar to exit without saving changes"
sync
if returnkey()=1
if exist(1) = 1 then delete file "options.dat"
open to write 1, "options.dat"
write long 1, volume#
write long 1, sfx#
close file 1
return
endif
if spacekey()=1 then return
sync
loop
derekalan18
visit my website @
www.johnsonsoftware.bravehost.com