As i was doing my game i ran into yet another problem that eliminates me from actually knowing how many questions i got right. it kinda works but it doesn't fully please help it tells me i have 8 questions right even if i have only 5 questions.
Rem Project: Dark Basic Pro Project
Rem Created: Monday, February 03, 2014
Rem ***** Main Source File *****
REM Project: The Most Electrifying Game
REM Created:
REM
REM ***** Main Source File *****
REM
autocam off
hide mouse
set text opaque
cls
Title:
cls
load bitmap "C:\Users\335551\Desktop\Pics/test1.bmp"
ink rgb (255,255,255),0 : set text font "arial" : set text size 15 : set text to normal
center text 300,360,"Hit I for instructions"
center text 300,380,"Hit G to start the game"
do
if inkey$ () ="i" then gosub Instructions:
if inkey$ () ="g" then gosub Main:
loop
Instructions:
cls
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 320,60," Instructions"
set text size 15
center text 320,160,"You get points for answering each question you get right"
center text 320,180,"But if you get one wrong you lose time on the timer and points"
center text 320,200,"answer as many questions as you can in the time given"
center text 320,220,"If YOU beat the game you get a special prize"
center text 320,240,"Have fun!"
ink rgb(0,255,0),0
center text 320,400,"Press B to go back to main Title"
do
if inkey$()="b" then gosub Title
loop
Main:
cls
load bitmap "E:\Pics\sexy.bmp"
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 305,60,"Question 1"
set text size 15
center text 320,160,"If you rub two balloons over a piece of wool, what will happen when you hold them close together?"
center text 300,280,"A: They get bigger"
center text 300,300,"B: They attract each other"
center text 300,320,"C: They pop"
center text 300,340,"D: They repel each other"
wait key
repeat
Elapsed=(Timer()-T)/-50
TimeLeft=seconds-elapsed
text 20,20,"Seconds Left: "+Str$(TimeLeft)
if inkey$ () ="d"
do
if inkey$ () ="d" then exit
loop
ProblemCorrect = 1
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$ () ="b"
do
if inkey$ () ="b" 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 timeleft <= 9 then text 105,20," "
if timeleft<= 99 then text 111,20," "
until timeleft = 0
gosub endgame
Level2:
cls
load bitmap "E:\Pics\sexy.bmp"
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 305,60,"Question 2"
set text size 15
center text 320,160,"Matter is defined by anything that takes up space and..."
center text 300,280,"A: Color"
center text 300,300,"B: Mass"
center text 300,320,"C: Smell"
center text 300,340,"D: Taste"
wait key
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=seconds-elapsed
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 Level3
endif
if inkey$ () ="a"
do
if inkey$ () ="a" then exit
loop
ProblemCorrect = 2
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 inkey$ () ="c"
do
if inkey$ () ="c" 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
gosub endgame
Level3:
cls
load bitmap "E:\Pics\sexy 2.bmp"
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 305,60,"Question 3"
set text size 15
center text 320,160,"The appearance of the Moon as observed from Earth changes over time because of the Moon’s?"
center text 300,280,"A: Legnth of day"
center text 300,300,"B: Gravity"
center text 300,320,"C: Tempature"
center text 300,340,"D: Path around the earth"
wait key
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=seconds-elapsed
text 20,20,"Seconds Left: "+Str$(TimeLeft)
if inkey$ () ="d"
do
if inkey$ () ="d" then exit
loop
ProblemCorrect = 1
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$ () ="b"
do
if inkey$ () ="b" then exit
loop
ProblemCorrect = 2
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 timeleft <= 9 then text 105,20," "
if timeleft<= 99 then text 111,20," "
until timeleft = 0
gosub endgame
level4:
cls
load bitmap "E:\Pics\sexy 3.bmp"
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 305,60,"Question 4"
set text size 15
center text 320,160,"What is the total number of rotations the Earth makes in 2 weeks?"
center text 300,280,"A: 4"
center text 300,300,"B: 2"
center text 300,320,"C: 14"
center text 300,340,"D: 5"
wait key
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=seconds-elapsed
text 20,20,"Seconds Left: "+Str$(TimeLeft)
if inkey$ () ="c"
do
if inkey$ () ="c" then exit
loop
ProblemCorrect = 1
AnswersCorrect = AnswersCorrect + 1
Seconds = Seconds + 5
gosub Level5
endif
if inkey$ () ="a"
do
if inkey$ () ="a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level5
endif
if inkey$ () ="b"
do
if inkey$ () ="b" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level5
endif
if inkey$ () ="d"
do
if inkey$ () ="d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level5
endif
if timeleft <= 9 then text 105,20," "
if timeleft<= 99 then text 111,20," "
until timeleft = 0
gosub endgame
Levelsplit:
cls
ink rgb (255,255,255),0 : set text font "Impact" : set text size 60 : set text to normal
center text 320,200,"History"
wait key
if inkey$ ()=" " then goto Level5
Level5:
cls
ink rgb (255,255,255),0 : set text font "Impact" : set text size 30 : set text to normal
center text 305,60,"Question 5"
set text size 15
center text 320,160,"How many oceans are there in the world?"
center text 300,280,"A: 4"
center text 300,300,"B: 5"
center text 300,320,"C: 14"
center text 300,340,"D: 5"
wait key
repeat
Elapsed=(Timer()-T)/1000
TimeLeft=seconds-elapsed
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 Level6
endif
if inkey$ () ="a"
do
if inkey$ () ="a" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level6
endif
if inkey$ () ="d"
do
if inkey$ () ="d" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level6
endif
if inkey$ () ="c"
do
if inkey$ () ="c" then exit
loop
ProblemCorrect = 2
Seconds = Seconds - 5
gosub Level6
endif
if timeleft <= 9 then text 105,20," "
if timeleft<= 99 then text 111,20," "
until timeleft = 0
gosub endgame
Level6:
endgame:
cls
ink rgb (255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,160,"FINISH"
set text size 15
set cursor 260,250
print "Correct Answers: "; (answerscorrect);"/50"
if AnswersCorrect = 50
center text 320,270,"You Did It!"
if Math50Correct = 0 then MathCorrect = 1
endif
center text 320,300,"Press the Space Bar to go"
center text 320,320,"back to main menu."
do
if SpaceKey()=1 then gosub Title
sync
loop
end
cls
ink rgb (255,255,255),0 : set text font "arial" : set text size 30 : set text to normal
center text 320,160,"FINISH"
set text size 15
set cursor 260,250
print "Correct Answers: "; (answerscorrect);"/50"
if AnswersCorrect = 50
center text 320,270,"You Did It!"
if Math50Correct = 0 then MathCorrect = 1
endif
center text 320,300,"Press the Space Bar to go"
center text 320,320,"back to main menu."
do
if SpaceKey()=1 then gosub Title
sync
loop