This one will work better

:
set window on
set display mode 320,240,16
Rem Serial Generator
dim waarde#(20)
name:
print "Your name must be at least 5 characters in length"
input "Type your registration name: ";naam$ :
sync on
if len(naam$)<5 or len(naam$)>20 then goto name
naam$=upper$(naam$)
if len(naam$)>4 and len(naam$)<11 then formule#=1
if len(naam$)>10 and len(naam$)<16 then formule#=2
if len(naam$)>15 and len(naam$)<21 then formule#=3
usednaam$=naam$
for letter= 1 to len(naam$)
waarde#(letter)=waarde(left$(usednaam$, 1), formule#)
serial$=serial$+str$(waarde#(letter))
if len(usednaam$)>0 then usednaam$=right$(usednaam$, len(usednaam$)-1)
cls
print "New value : ";waarde#(letter)
print
print "New serial : ";serial$
print "Len Serial : ";len(serial$)
print
print "Usednaam$ : ";usednaam$
print
print "Letter: ";left$(usednaam$, 1)
sync
suspend for key
next letter
while len(serial$)>20
lr#=rnd(1)
if lr#=0 then serial$=left$(serial$, len(serial$)-1)
if lr#=1 then serial$=right$(serial$, len(serial$)-1)
cls
print "Serial : ";serial$
print "len serial: ";len(serial$)
print "Lr: ";lr#
sync
suspend for key
endwhile
while len(serial$)<20
cls
print "Serial : ";serial$
print "len serial: ";len(serial$)
sync
suspend for key
new$=Mid$(serial$, len(serial$)-1)
serial$=serial$+new$
endwhile
cls
print "--------------------------------------------------------------------------"
print "All Done! :D!"
print "--------------------------------------------------------------------------"
print "Name : ";naam$
print "Serial : ";serial$
print "--------------------------------------------------------------------------"
print "Size Serial : ";len(serial$)
print "--------------------------------------------------------------------------"
write to clipboard serial$
sync
suspend for key
end
function waarde(letter$, folume#)
if folume#=1 then gen#=64
if folume#=2 then gen#=38
if folume#=3 then gen#=2
if letter$="A" then waarde#=24
if letter$="B" then waarde#=87
if letter$="C" then waarde#=42
if letter$="D" then waarde#=96
if letter$="E" then waarde#=17
if letter$="F" then waarde#=98
if letter$="G" then waarde#=78
if letter$="H" then waarde#=77
if letter$="I" then waarde#=32
if letter$="J" then waarde#=56
if letter$="K" then waarde#=90
if letter$="L" then waarde#=21
if letter$="M" then waarde#=27
if letter$="N" then waarde#=88
if letter$="O" then waarde#=83
if letter$="P" then waarde#=43
if letter$="Q" then waarde#=69
if letter$="R" then waarde#=33
if letter$="S" then waarde#=61
if letter$="T" then waarde#=50
if letter$="U" then waarde#=94
if letter$="V" then waarde#=53
if letter$="W" then waarde#=89
if letter$="X" then waarde#=37
if letter$="Y" then waarde#=25
if letter$="Z" then waarde#=99
if letter$=" " then waarde#=22
waardes#=waarde#*gen#
endfunction waardes#
Your generated serial is copied to the clipboard
Do you need a complete FPS,3rdPS engine

?? Or a collision command libary?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0