Posted: 18th Feb 2003 18:15
LOL, everyone having a little go at my first ever game, that's a good sign
Posted: 20th Feb 2003 1:07
Cool
Posted: 28th Feb 2003 23:24
Ok I've put together some timed input. After some introduction you get 30 seconds to guess the code. You have to press enter to verify the code. The inkey$ / entry$ commands weren't working for me so I.. heh.. wrote my own. That's why it's so long winded. The function I wrote is very limited, so the code has to be in capitals and has to only contain letters and numbers. It isn't commented because DBPro didn't like comments near the function for some reason. Anyway, enjoy. Daz, you can take this code and learn from it if you want. It was completely written from scratch in about 20 mins, it doesn't directly contain any of your original code.

Watch for the fading when you enter an incorrect code...

+ Code Snippet
sync on
sync rate 60
hide mouse

code$="DARKBASIC"

dim message$(8)
message$(0)="Welcome to MircoSoft Bomb Defuser XP!  by The Darthster"
message$(1)="Checking for new hardware..."
message$(2)="Warning, bomb detected!"
message$(3)="Please enter the product code for your bomb."
message$(4)="It should be printed on the Certificate of Authenticity."
message$(5)="You have 30 seconds to comply..."
message$(6)="Thank you.  The bomb has successfully been defused."
message$(7)="Warning, your processor will shortly undergo nuclear fusion."

for i=0 to 5
 for j=1 to len(message$(i))
  text j*8,i*20,mid$(message$(i),j)
  sync
  wait 50
 next j
 wait 1000
next i

t#=timer()+30000

set text opaque

do

d=c
c=scancode()
if d<>c
 m$=m$+textinput(c)
 if c=14 then m$=left$(m$,len(m$)-1)
 if c=28
  if m$=code$
   codeguessed=1
  else
   ink 0,0
   for i=1 to len(m$)+1
    text i*8,120,"_"
   next i
   m$=""
   ink rgb(255,0,0),0
   incorrectcode=255
  endif
 endif
endif

if codeguessed=1
 ink rgb(255,255,255),0
 for j=1 to len(message$(6))
  text j*8,160,mid$(message$(6),j)
  sync
  wait 50
 next j
 sync
 suspend for key
 end
endif

ink 0,0
for i=1 to len(m$)+1
 text i*8,120,"_"
next i

ink rgb(255,255,255),0
text 8,120,m$

if int(((t#+30000)-timer())/1000)=0
 ink rgb(255,255,255),0
 for j=1 to len(message$(7))
  text j*8,160,mid$(message$(7),j)
  sync
  wait 50
 next j
 suspend for key
 end
endif

ink rgb(255-(int(((t#)-timer())/1000)*8.5),(int(((t#)-timer())/1000)*8.5),0),0
text 8,140,space$(80)
text 8,140,"You have "+str$((((t#)-timer())/1000))+" seconds remaining."

ink rgb(incorrectcode,0,0),0
text 200,200,"Incorrect code!"
incorrectcode=incorrectcode*0.997

sync
loop

end

function textinput(c)
select c
case 2
n$="1"
endcase
case 3
n$="2"
endcase
case 4
n$="3"
endcase
case 5
n$="4"
endcase
case 6
n$="5"
endcase
case 7
n$="6"
endcase
case 8
n$="7"
endcase
case 9
n$="8"
endcase
case 10
n$="9"
endcase
case 11
n$="0"
endcase
case 16
n$="Q"
endcase
case 17
n$="W"
endcase
case 18
n$="E"
endcase
case 19
n$="R"
endcase
case 20
n$="T"
endcase
case 21
n$="Y"
endcase
case 22
n$="U"
endcase
case 23
n$="I"
endcase
case 24
n$="O"
endcase
case 25
n$="P"
endcase
case 30
n$="A"
endcase
case 31
n$="S"
endcase
case 32
n$="D"
endcase
case 33
n$="F"
endcase
case 34
n$="G"
endcase
case 35
n$="H"
endcase
case 36
n$="J"
endcase
case 37
n$="K"
endcase
case 38
n$="L"
endcase
case 44
n$="Z"
endcase
case 45
n$="X"
endcase
case 46
n$="C"
endcase
case 47
n$="V"
endcase
case 48
n$="B"
endcase
case 49
n$="N"
endcase
case 50
n$="M"
endcase
endselect
endfunction n$
Posted: 4th Mar 2003 18:39
french translation mk2 : translated by a french ^^

+ Code Snippet
GameFrench:
INK RGB(255,0,0), RGB(0,0,0)
CLS
HIDE MOUSE
BACKDROP OFF
SET CURSOR 100, 300
INPUT "Entrez votre nom, terroriste : ", tname$
CLS
SET CURSOR 100, 320
PRINT "Vous êtes dans la zone de la bombe."
SET CURSOR 100, 340
PRINT "Appuyer n'importe quelle touche pour continuer. "
WAIT KEY
CLS
MAKE PARTICLES 1, 1, 100, 500
COLOR PARTICLES 1, 255, 0, 0
HIDE PARTICLES 1
SET CURSOR 100, 300
INPUT "Choisissez un code secret pour le C4 :", tcode$
SET CURSOR 100, 320
PRINT tname$;" règle la bombe!"
WAIT 3000
SET CURSOR 100, 340
PRINT "Appuyer n'importe quelle touche pour continuer. "
WAIT KEY
INK RGB(0,128,255), RGB(0,0,0)
CLS
SET CURSOR 100, 300
INPUT "Entrer votre nom, contre-terroriste : ", ctname$
CLS
SET CURSOR 100, 300
PRINT "Il faut désamorcer la bombe!"
SET CURSOR 100, 320
INPUT "Entrez le code : ", ctcode$
IF ctcode$ = tcode$
CLS
SET CURSOR 100, 300
PRINT ctname$;" a désamorcé la bombe!"
SET CURSOR 100, 320
PRINT "Le cible a été épargné!"
SET CURSOR 100, 340
PRINT "Les contre-terroristes gagnent!"
WAIT 5000
CLS
SET CURSOR 100, 300
PRINT "Appuyer n'importe quelle touche pour terminer."
WAIT KEY
END
ELSE
CLS
SET CURSOR 100, 300
PRINT "Le code inexact, le minuteur va de plus en plus vite..."
FOR A = 10 TO 1 STEP -1
SET CURSOR 100, 300
PRINT A
WAIT 1000
CLS
NEXT A
SHOW PARTICLES 1 : WAIT 5000 : DELETE PARTICLES 1
SET CURSOR 100, 300
PRINT "Le cible a été détruite!"
SET CURSOR 100, 320
PRINT "Les terroristes gagnent! "
SET CURSOR 100, 340
PRINT "Appuyer SPACEKEY pour jouer encore, ou Return pour terminer. "
WAIT KEY
IF SPACEKEY() = 1 THEN CLS : GOSUB GameFrench
IF RETURNKEY() = 1 THEN END
ENDIF
END


and for when a multiplayer version ? lol ^^