I'm making a simple game for a contest in DBPro and I need to put a bibliograpy in it. I tried to put it right before the user quits but that didn't work.
I think i have to much media to bother you with but it's worth a try.
Ok when i rem everything before my gameplay it works. But when i don't it doesn't. But what i did before the gameplay shouldn't matter because i erased everything.
I am very confused. Please help.
Rem Project: Technology Fair
Rem Created: 10/7/2005 9:29:38 PM
Rem ***** Main Source File *****
sync on
hide mouse
sync rate 30
randomize timer()
Global num1
Global num2
Global num3
Global TextHeight
Global TextColumn
Global Score
Global Lives
Global Answer as string
Global LastInput as string
Global InputLength
Global AnswerLength
load image "Main Title Screen(animated).bmp",1
create animated sprite 1,"Main Title Screen(animated).bmp",1,2,1
sprite 1,100,100,1
stretch sprite 1,70,65
do
play sprite 1,1,2,500
if returnkey()=1 then goto secondary_title
sync
loop
secondary_title:
load image "Secondary Title Screen.bmp",2
sprite 2,100,0,2
scale sprite 2,90
load image "cursor Full.bmp",3
create animated sprite 3,"cursor Full.bmp",3,2,3
scale sprite 3,15
delete sprite 1
Global FPS#
load music "C:Documents and SettingsCory AccountDesktopmediaPatriotic-Stars and Stripes Forever.mp3",2
load music "C:Documents and SettingsCory AccountDesktopmedia! Proud to be an AMERICAN patriotic tribute America NY Bombing George Bush Proud to be an American.mp3",1
load music "C:Documents and SettingsCory AccountDesktopmediaacappella - proud to be an american.mp3",3
load music "C:Documents and SettingsCory AccountDesktopmediaWhitney houston national anthem.mp3",4
play music 2
do
sprite 3,mousex()-45,mousey()-25,3
play sprite 3,1,6,50
Menu(260,210,375,275,"Play")
Menu(210,280,420,345,"Options")
Menu(180,355,485,410,"Instructions")
rem print "Mouse pos:",mousex(),",",mousey()
sync
loop
function Menu(posX,posY,posX2,posY2,mos$)
if rollOver(posX,posY,posX2,posY2)=1 and mouseclick() = 1
rem ink RGB(0,240,0),rgb(0,240,0)
rem box posX+5,posY+5,posX2+5,posY2+5
if mos$ = "Play"
goto SelectDifficulty
endif
if mos$ = "Options"
gosub Options
endif
if mos$ = "Instructions"
gosub Instructions
endif
endif
endfunction
function rollOver(posX,posY,posX2,posY2)
x = mouseX() : y = mouseY()
if ((x>posX) and (x<posX2) and (y>posY) and (y<posY2))
over#=1
else
over#=0
endif
endfunction over#
SelectDifficulty:
delete sprite 2
delete sprite 3
Global difficulty#
load image "select difficulty.bmp",5
sprite 5,0,0,5
load image "easy selected.bmp",6
load image "medium selected.bmp",7
load image "hard selected.bmp",8
sprite 8,0,0,7
do
if sprite image(8) = 7 and leftkey()=1
set sprite image 8,6
wait 300
endif
if sprite image(8) = 8 and leftkey()=1
set sprite image 8,7
wait 300
endif
if sprite image(8) = 6 and rightkey()=1
set sprite image 8,7
wait 300
endif
if sprite image(8) = 7 and rightkey()=1
set sprite image 8,8
wait 300
endif
if returnkey()=1
difficulty#=sprite image(8)-5
goto GameStart
endif
sync
loop
Options:
hide sprite 2
dim CSprite(1)
if image exist(10)=0 then load image "Show FPS(on).bmp",10
if image exist(11)=0 then load image "Show FPS(off).bmp",11
CSprite(0)=10
CSprite(1)=timer()
while returnkey()=0
sprite 3,mousex()-45,mousey()-25,3
play sprite 3,1,6,50
set sprite priority 3,1
Menu2(295,50,355,100)
sprite 11,0,0,CSprite(0)
sync
endwhile
delete sprite 11
show sprite 2
return
function Menu2(posX,posY,posX2,posY2)
if rollOver(posX,posY,posX2,posY2)=1 and mouseclick() = 1
` Switch for CSprite(0)
if timer()>CSprite(1)+100
if CSprite(0)=10
CSprite(0)=11
FPS#=0
else
CSprite(0)=10
FPS#=1
endif
CSprite(1)=timer()
wait 10
endif
endif
endfunction
Instructions:
load image "Instructions.bmp",9
hide sprite 2
hide sprite 3
while returnkey()=0
sprite 9,0,0,9
sync
endwhile
delete sprite 9
show sprite 2
show sprite 3
return
GameStart:
FPS#=1
delete sprite 5
delete sprite 8
delete image 1
delete image 2
delete image 3
delete image 5
delete image 6
delete image 7
delete image 8
stop music 2
play music 1
ink RGB(255,255,255),rgb(0,0,0)
cls
disable escapekey
wait 800
flush video memory
sync rate 40
randomize timer()
Global num1
Global num2
Global num3
Global TextHeight
Global TextColumn
Global Score
Global Lives
Global Answer as string
Global LastInput as string
Global InputLength
Global AnswerLength
cls
while spacekey()=0
print "Press SpaceBar to Start"
endwhile
disable escapekey
NewGame()
repeat
cls
Game()
sync
B$ = inkey$()
until B$ = "e" or B$ = "E"
if B$ = "e" or B$ = "E"
Print "Music provided by: http://www.pro-american.com/Free_Music/free_music.html"
wait 1000
end
endif
function Game()
DisplayProblem()
GetUserInput()
CheckAnswer()
CheckHeight()
endfunction
function DisplayProblem()
set cursor 0,0
Print "Lives: ",Lives," Score: ",Score
if FPS#=1
set cursor 200,0
print "FPS: ",screen fps()
endif
text 300,0,"E-Exit"
set cursor TextColumn,TextHeight+80
print str$(num1)+"+"+ str$(num2)
inc TextHeight,2
textc=rnd(2)
if textc=0 then ink rgb(255,0,0),rgb(255,255,255)
if textc=1 then ink rgb(0,0,255),rgb(255,0,0)
if textc=2 then ink rgb(255,255,255),rgb(0,0,255)
endfunction
function GetUserInput()
I$ = inkey$()
if I$<>""
if I$ <> LastInput
LastInput = I$
inc InputLength,1
Answer = Answer + I$
LastInput = I$
endif
else
LastInput =""
endif
endfunction
function CheckAnswer()
if InputLength = AnswerLength
if val(Answer) = num3
inc Score,50
NewProblem()
else
I$ = ""
Answer = ""
InputLength = 0
endif
endif
if InputLength > AnswerLength
I$ = ""
Answer = ""
InputLength = 0
endif
endfunction
function CheckHeight()
if TextHeight > 350 then Failed()
endfunction
function NewProblem()
num1 = rnd(10)
num2 = rnd(10)
num3 = num1 + num2
AnswerLength = len(str$(num3))
InputLength = 0
I$ = ""
TextHeight = 15
Answer = ""
a$=str$(num1)+"+"+str$(num2)
TextColumn=rnd(640-text width(a$))
endfunction
function Failed()
dec Lives
if Lives < 1
stop music 1
play music 4
cls
Print "Game Over"
print ""
print "Your Score was ",Score," ... Well done!"
print ""
print "Do you want to play again? Y/N"
sync
repeat
A$ = inkey$()
until A$ = "y" or A$ = "Y" or A$ = "n" or A$ = "N"
if A$ = "Y" or A$ = "y"
NewGame()
else
end
endif
else
NewProblem()
endif
endfunction
function NewGame()
Lives = 3
Score = 0
NewProblem()
endfunction
boogers will take over the world