Could anyone tell me why in the following code if i set it to print the difficulty lvl or time it pops up with nothing.
do
button("Play",20,1,1)
button("Difficulty",20,81,2)
button("Controls",20,162,3)
button("Length of Game",20,243,4)
button("Credits",20,324,5)
sync
loop
play2:
print "your in play2"
wait 150
return
function button(caption$,size,top,number)
if mousex()>screen width()/2-5*size and mousex()<screen width()/2+5*size and mousey()>top and mousey()<top+4*size then ink rgb(100,100,0), rgb(100,100,0)
line screen width()/2-5*size,top,screen width()/2+5*size,top
line screen width()/2-5*size,top,screen width()/2-5*size,top+4*size
line screen width()/2-5*size,top+4*size,screen width()/2+5*size,top+4*size
line screen width()/2+5*size,top+4*size,screen width()/2+5*size,top
ink rgb(255,255,255),rgb(255,255,255)
text screen width()/2-text width(caption$)/2,top+2*size-text height(caption$)/2,caption$
if mousex()>screen width()/2-5*size and mousex()<screen width()/2+5*size and mousey()>top and mousey()<top+4*size and mouseclick()=1
if number=1 then gosub play
if number=2 then gosub Difficulty
if number=3 then gosub Controls
if number=4 then gosub playtime
if number=5 then gosub credits
endif
goto back
Play:
gosub play2
return
Difficulty:
if dif=1
global dif=2
goto difend
endif
if dif=2
global dif=3
goto difend
endif
if dif=3
global dif=1
goto difend
endif
difend:
return
Controls:
cls
text 0,250,"Select time to play"
text 0,300,"Arrows to move."
text 0,350,"There are three difficulty settings."
text 0,400,"Press any key to continue."
suspend for key
cls
return
playtime:
if time=1
global time=60
goto timeend
endif
if time=2
global time=30
goto timeend
endif
if time=3
global time=15
goto timeend
endif
timeend:
wait 150
cls
return
credits:
cls
text 0,250,"Lead Design: Charles Smith"
text 0,300,"Models, pictures, etc. Freebies off of turbosquid."
text 0,350,"Suggestions and help from The Game Creators Forums."
text 0,400,"Press any key to continue."
suspend for key
cls
return
back:
endfunction
[edit]
ok i've got it to change the time now...
and ill update the code for it.
do
button("Play",20,1,1)
button("Difficulty",20,81,2)
button("Controls",20,162,3)
button("Length of Game",20,243,4)
button("Credits",20,324,5)
sync
loop
play2:
print "your in play2"
wait 150
return
function button(caption$,size,top,number)
if mousex()>screen width()/2-5*size and mousex()<screen width()/2+5*size and mousey()>top and mousey()<top+4*size then ink rgb(100,100,0), rgb(100,100,0)
line screen width()/2-5*size,top,screen width()/2+5*size,top
line screen width()/2-5*size,top,screen width()/2-5*size,top+4*size
line screen width()/2-5*size,top+4*size,screen width()/2+5*size,top+4*size
line screen width()/2+5*size,top+4*size,screen width()/2+5*size,top
ink rgb(255,255,255),rgb(255,255,255)
text screen width()/2-text width(caption$)/2,top+2*size-text height(caption$)/2,caption$
if mousex()>screen width()/2-5*size and mousex()<screen width()/2+5*size and mousey()>top and mousey()<top+4*size and mouseclick()=1
if number=1 then gosub play
if number=2 then gosub Difficulty
if number=3 then gosub Controls
if number=4 then gosub playtime
if number=5 then gosub credits
endif
goto back
Play:
gosub play2
return
Difficulty:
if dif=1
global dif=2
goto difend
endif
if dif=2
global dif=3
goto difend
endif
if dif=3
global dif=1
goto difend
endif
difend:
return
Controls:
cls
text 0,250,"Select time to play"
text 0,300,"Arrows to move."
text 0,350,"There are three difficulty settings."
text 0,400,"Press any key to continue."
suspend for key
cls
return
playtime:
if mouseclick() = 1 and clickcount = 2
time = 60
global clickcount = 0
goto timeend
endif
if mouseclick() = 1 and clickcount = 1
time = 30
global clickcount = 2
goto timeend
endif
if mouseclick() = 1 and clickcount = 0
time=15
global clickcount = 1
goto timeend
endif
timeend:
print time
wait 150
return
credits:
cls
text 0,250,"Lead Design: Charles Smith"
text 0,300,"Models, pictures, etc. Freebies off of turbosquid."
text 0,350,"Suggestions and help from The Game Creators Forums."
text 0,400,"Press any key to continue."
suspend for key
cls
return
back:
endfunction
now lets see if i can get the difficulty to work, shouldn't be to hard now.
[edit]
YAY IT WORKS
im not going to put the code unless you want to see it... although i just did the same thing, and changed clickcount to dccount and pccount to be more percise
If at first you dont succeed, LOWER YOUR STANDARDS.