set display mode 800,600,16
Global game$
Global height : height=600
Global width : width=800
set window on
maximize window
hide mouse
disable escapekey
randomize timer()
dim spanish$(55)
for N=0 to 55
read spanish$(N)
next N
dim english$(55)
for N=0 to 55
read english$(N)
next N
data "el alfabeto", "un alfabeto", "la campana","las campanas", "una campana", "unas campanas", "el libro", "los libros", "un libro", "unos libros", "la estanteria", "las estanterias", "una estanteria", "unas estanterias", "el cacto","un cacto", "el calendario", "un calendario", "la tiza", "el creyon", "los creyones", "la altavoz", "las altavoces", "una altavoz","unas altavoces","el mapa","los mapas","un mapa","unos mapas","el cuaderno","un cuaderno","el papel","el lapiz","los lapices","un lapiz","unos lapices","la grapa","las grapas","una grapa","unas grapas","un sacapuntas","el sacapuntas","un boligrafo","la pluma","el pupitre","el reloj","los relojes","un reloj","el mapa","some maps","grapadora","tablon de noticias","computadora","suelo","disco","caja"
data "the alphabet", "an alphabet", "the bell", "the bells", "a bell", "some bells", "the book", "the books", "a book", "some books", "the bookshelf", "the bookshelves", "a bookshelf", "some bookshelves", "the cactus", "a cactus", "the calendar", "a calendar", "the chalk", "the crayon", "the crayons", "the speaker", "the speakers","a speaker","some speakers","the map","the maps","a map","some maps","the notebook","a notebook","the paper","the pencil","the pencils","a pencil","some pencils","the staple","the staples","a staple","some staples","a pencil sharpener","the pencil sharpener","a pen (m)","the pen (f)","the student desk","the clock","the clocks","a clock","the map","unos mapas","stapler","bulletin board","computer","floor","disc","box"
ink rgb(0,200,0),rgb(0,0,200)
load music "Techy2-Version2 Rendered.mp3",1; load sound "Sirens2.wav",2;load sound "Space Age Motor Cycle 03.wav",1; load sound "3.wav",3;load sound "X APPL7.wav",4;load sound "CHANGEPLEASE.WAV",5
start:
load image "1.png",1; sprite 1,50,20,1;set sprite 1,1,1;wait 2000;delete sprite 1;load image "2.png",1; sprite 1,50,20,1;set sprite 1,1,1; play sound 3;wait 5000;delete sprite 1
choosegame:
HandleMainMenu()
set text size 18
`clear entry buffer
`game$=entry$(1)
`repeat
`game$=entry$(1)
`cls
`print "English to Spanish (1) or Spanish to English (2)? ";game$
`until returnkey()=1
if game$="1" then play sound 1;wait 2000;clear entry buffer ; engspan()
if game$="2" then play sound 1;wait 2000;clear entry buffer ; spaneng()
if game$<>"1" and game$<>"2" then print ""
cls
if game$<> "1" and game$<>"2" then goto choosegame:
function engspan()
loop music 1
do
cls
S=rnd(55)
english$=english$(S)
spanish$=spanish$(S)
clear entry buffer
repeat
answer$=entry$(1)
cls
set text size 24
ink rgb(0,200,0),0
print "Correct: ";right
ink rgb(200,0,0),0
print "Incorrect: ";wrong
print ""
set text size 18
ink rgb(255,255,255),0
print "Type the following word in Spanish..."
print ""
print ""; english$ ; ": "; answer$
until returnkey()=1
if answer$=spanish$
cls
set text size 54
ink rgb(0,200,0),0
play sound 4
center text 299,199, "¡CORRECTO!"
wait 3000
inc right
endif
if answer$<>spanish$
cls
set text size 54
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
play sound 2
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
center text 299,99,english$
center text 299,199,spanish$
set text size 24
wait 3000
inc wrong
endif
inc Q
if Q=30
cls
set text size 32
ink rgb(0,200,0),0
Q=0
stop music 1
print "Final Correct: ";right
ink rgb(200,0,0),0
print "Final Incorrect: ";wrong
wait 3000
stop music 1
if right>=21
cls
play sound 5
load image "me.png",1; sprite 1,149,49,1;set sprite 1,1,1
wait 5000
end
else
cls
ink rgb(0,200,0),0
center text 299,199, "TRY AGAIN"
right=0
wrong=0
wait 5000
cls
goto start:
endif
endif
loop
endfunction
function spaneng()
cls
print ""
print ""
print ""
print ""
print "When pen is the answer, you must specify its gender: pen (f) or pen (m)"
wait 5000
loop music 1
do
cls
S=rnd(55)
english$=english$(S)
spanish$=spanish$(S)
clear entry buffer
repeat
answer$=entry$(1)
cls
set text size 24
ink rgb(0,200,0),0
print "Correct: ";right
ink rgb(200,0,0),0
print "Incorrect: ";wrong
print ""
set text size 18
ink rgb(255,255,255),0
print "Type the following word in English..."
print ""
print "";spanish$;": ";answer$
until returnkey()=1
if answer$=english$
cls
set text size 54
ink rgb(0,200,0),0
play sound 4
center text 299,199, "¡CORRECTO!"
wait 3000
inc right
endif
if answer$<>english$
cls
set text size 54
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
play sound 2
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
ink rgb(200,0,0),0
center text 299,199, "¡INCORRECTO!"
wait 300
ink rgb(0,0,200),0
center text 299,199, "¡INCORRECTO!"
wait 300
cls
center text 299,99,english$
center text 299,199,spanish$
set text size 24
wait 3000
inc wrong
endif
inc Q
if Q=30
cls
set text size 32
ink rgb(0,200,0),0
Q=0
stop music 1
print "Final Correct: ";right
ink rgb(200,0,0),0
print "Final Incorrect: ";wrong
wait 3000
stop music 1
if right>=21
cls
play sound 5
load image "me.png",1; sprite 1,149,49,1;set sprite 1,1,1
wait 5000
end
else
cls
ink rgb(0,200,0),0
center text 299,199, "TRY AGAIN"
right=0
wrong=0
wait 5000
cls
goto start:
endif
endif
loop
endfunction
Function HandleMainMenu()
game$="" : show mouse
do
mouseclicked=mouseclick()
cls
Rem get the X and Y positions based off of a formula so no matter the resolution the position will remain the same
text$="English to Spanish"
x#=(width/100.0)*50
x#=x#-(Text Width(text$)/2.0)
y#=(height/100.0)*45
y#=y#-(Text Height(text$)/2.0)
Text x#,y#,text$
Rem check mouse position relative to text position
if mouseclicked=1 and MouseWithin(x#,y#,Text Width(text$),Text Height(text$)) then game$="1"
`
text$="Spanish to English"
x#=(width/100.0)*50
x#=x#-(Text Width(text$)/2.0)
y#=(height/100.0)*50
y#=y#-(Text Height(text$)/2.0)
Text x#,y#,text$
Rem check mouse position relative to text position
if mouseclicked=1 and MouseWithin(x#,y#,Text Width(text$),Text Height(text$)) then game$="2"
`
text$="Quit"
x#=(width/100.0)*50
x#=x#-(Text Width(text$)/2.0)
y#=(height/100.0)*55
y#=y#-(Text Height(text$)/2.0)
Text x#,y#,text$
Rem check mouse position relative to text position
if mouseclicked=1 and MouseWithin(x#,y#,Text Width(text$),Text Height(text$)) then end
`
sync
if game$<>"" then exit
loop
Hide Mouse
Endfunction
Function MouseWithin(x#,y#,w#,h#)
if mousex()>=x# and mousex()=<x#+w# and mousey()>=y# and mousey()<=y#+h#
output=1
endif
Endfunction output
Here you go, I changed some intention in your spaneng() and engspan() functions. I also added it so now the main menu uses buttons instead of having to use the keyboard to specify if you would like to do "English to Spanish" or "Spanish to English". If theres anything else you would like me to add/change just ask

.