Hello. I am creating a quiz game called Edumania. Basically its a quiz and your supposed to try to answer all the questions in a certain amount of time.
Basically, the starting screen says "x to skip instructions. y to read the instructions." The x moves you to this modeselect but instead its moving me to GetReady1 and completely skipping modeselect.
Here is my whole code:
REM PROJECT
REM SCIENCE PROJECT
autocam off
title:
cls
ink rgb (255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,60, "Welcome Science Mania!"
set text size 15
center text 320,160, "Press X if you don't want to read the instructions"
center text 320,180, "Press H if you want to read the instructions"
do
if inkey$()="x" then gosub ModeSelect
if inkey$()="h" then gosub Instructions
loop
Instructions:
cls
ink rgb (0,255,0),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,60, "Instructions"
ink rgb (255,255,255),0
set text size 15
Center text 320,160, "Welcome to the Science Mania Test Prep! In this Game"
center text 320,180, "you have to answer as many problems as you can"
center text 320,200, "before the timer runs out."
center text 320,220, "Good Luck!"
ink rgb (0,255,0),0
center text 320,420, "Press SPACE to start"
center text 320,400, "Press B to go back"
do
if inkey$()="b" then gosub title
loop
ModeSelect:
cls
ink rgb (255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200,"Which subject do you want to select?"
set text size 15
text 240,280,"1.)Math"
text 240,300,"2.)History"
text 240,320,"3.)Science"
center text 320,380, "Press B to go back"
do
if inkey$()="1"
do
if inkey$() <> "1" then exit
loop
goto Math
endif
return
if inkey$()="2"
do
if inkey$() <> "2" then exit
loop
goto History
endif
return
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
goto title
endif
return
Math:
cls
ink rgb(255,255,255),0 : set text font "arial": set text size 30 : set text to normal
center text 320,200, "Get Ready!"
set text size 15
center text 320,260, "Press the space bar to go start"
center text 320,280, "Press B to go back"
do
if inkey$()="b" then gosub title
if Spacekey()=1 then gosub Level12
loop
Level1:
cls
ProblemCorrect = 0
AnswersCorrect = 0
Seconds = 15
T=Timer()
rem put bitmap here later
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200,"What is 2+2?"
set text size 15
text 240,280, "A.)2"
text 240,300, "B.)1"
text 240,320, "C.)3"
text 240,340, "D.)4"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 2
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds - 5
gosub Level2
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level2
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level2
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 1
Seconds = Seconds + 5
gosub Level2
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
end
Level2:
cls
rem load bitmap here
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200, "What is 99+1?"
set text size 15
if ProblemCorrect = 1 then ink rgb(0,255,0),0 : center text 320,150, "CORRECT! +5 SECONDS"
if ProblemCorrect = 2 then ink rgb(255,0,0),0 : center text 320,150, " WRONG! -5 SECONDS"
ink rgb(255,255,255),0
text 240,280,"A.)50"
text 240,300,"B.)60"
text 240,320,"C.)100"
text 240,340,"D.)98"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 2
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds - 5
gosub Level3
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level3
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 1
Seconds = Seconds + 5
gosub Level3
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level3
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
Level3:
cls
rem load bitmap here
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200, "What is 56.1+82.3?"
set text size 15
if ProblemCorrect = 1 then ink rgb(0,255,0),0 : center text 320,150, "CORRECT! +5 SECONDS"
if ProblemCorrect = 2 then ink rgb(255,0,0),0 : center text 320,150, " WRONG! -5 SECONDS"
ink rgb(255,255,255),0
text 240,280,"A.)133.4"
text 240,300,"B.)125.4"
text 240,320,"C.)116.2"
text 240,340,"D.)118.4"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 2
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds + 5
gosub Level4
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 1
Seconds = Seconds + 5
gosub Level4
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level4
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level4
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
Level4:
cls
rem load bitmap here
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200, "What is 216.7 - 117.4?"
set text size 15
if ProblemCorrect = 1 then ink rgb(0,255,0),0 : center text 320,150, "CORRECT! +5 SECONDS"
if ProblemCorrect = 2 then ink rgb(255,0,0),0 : center text 320,150, " WRONG! -5 SECONDS"
ink rgb(255,255,255),0
text 240,280,"A.)117.6"
text 240,300,"B.)104.3"
text 240,320,"C.)99.3"
text 240,340,"D.)89.3"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 2
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds - 5
gosub Level4
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level4
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 1
Seconds = Seconds + 5
gosub Level4
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level4
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
History:
cls
ink rgb(255,255,255),0 : set text font "arial": set text size 30 : set text to normal
center text 320,200, "Get Ready!"
set text size 15
center text 320,260, "Press the space bar to go start"
center text 320,280, "Press B to go back"
do
if inkey$()="b" then gosub title
if Spacekey()=1 then gosub Level12
loop
Level12:
cls
ProblemCorrect = 0
AnswersCorrect = 0
Seconds = 15
T=Timer()
rem put bitmap here later
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200,"Who is the second president of the United States?"
set text size 15
text 240,280, "A.)Theodore Rosevelt"
text 240,300, "B.)John Adams"
text 240,320, "C.)George Washington"
text 240,340, "D.)Andrew Jackon"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 1
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds + 5
gosub Level22
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level22
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level22
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level22
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
Level22:
cls
rem load bitmap here
ink rgb(255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200, "What was the first war in the United States?"
set text size 15
if ProblemCorrect = 1 then ink rgb(0,255,0),0 : center text 320,150, "CORRECT! +5 SECONDS"
if ProblemCorrect = 2 then ink rgb(255,0,0),0 : center text 320,150, " WRONG! -5 SECONDS"
ink rgb(255,255,255),0
text 240,280,"A.)The War of 1812"
text 240,300,"B.)The Indian American War"
text 240,320,"C.)The Revolutionary War"
text 240,340,"D.)World War II"
...
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
ink rgb(0,0,0),0
box 20,20,120,40
ink rgb(255,255,255),0
Text 20,20,"Seconds Left: "+Str$(TimeLeft)
...
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
ProblemCorrect = 2
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds - 5
gosub Level22
endif
if inkey$()="a"
do
if inkey$() <> "a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level22
endif
if inkey$()="c"
do
if inkey$() <> "c" then exit
loop
ProblemCorrect = 1
Seconds = Seconds + 5
gosub Level22
endif
if inkey$()="d"
do
if inkey$() <> "d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level22
endif
if TimeLeft <= 9 then Text 105,20," "
if TimeLeft <= 99 then Text 111,20," "
until TimeLeft = 0
end
loop
end
Here is the ModeSelect:
ModeSelect:
cls
ink rgb (255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,200,"Which subject do you want to select?"
set text size 15
text 240,280,"1.)Math"
text 240,300,"2.)History"
text 240,320,"3.)Science"
center text 320,380, "Press B to go back"
do
if inkey$()="1"
do
if inkey$() <> "1" then exit
loop
goto Math
endif
if inkey$()="2"
do
if inkey$() <> "2" then exit
loop
goto History
endif
if inkey$()="b"
do
if inkey$() <> "b" then exit
loop
goto title
endif
Thank you for your help