ok firstly to find the scancode run this mini program and press the buttons on the keyboard.
it will tell you the corresponding scancode variable for that particular key.
backdrop on : do : print scancode() : sync : loop
The next part is how to use them
here is an example
rem yes "y"
if scancode()=21 then DiffuseBomb()
rem no "n"
if scancode()=49 then QuitMission()
But the structure of your program is going to get real confusing.
I think you should learn how functions work now.
I took your game and made it into functions and changed one of the inkey$ commands to the scancode leaving the other one for you to alter. It took me about 20 minutes to convert it into functions which will save you a tonne of time and headaches.
Have a look at the way i have made your program and tell me if you find that easier to manage.
Try to avoid using gotos as a super last last last resort then dont use gosubs if u can help it and stick with functions.
I also made your game dynamic so each time you run it only one of the wires will deactivate the bomb randomly each time you play it.
sample code works in DBC/DBP
rem ----------------------------------------------------------------------
rem The Nerds Bomb Game
rem DBC
rem
rem
rem function support by indi
rem
rem ----------------------------------------------------------------------
rem PROGRAM SETUP
sync on : sync rate 60
set text font "verdana" : set text size 14
randomize timer()
rem GLOBAL VARIABLE DECLARATIONS
rem bombs secret number is from 1 - 3
dim BombCode(1) : BombCode(1) = rnd(2)+1
rem MAIN GAME AREA
Introduction()
GetUserName()
MissionObjectives()
Mission()
EndProgram()
REM FUNCTIONS
function Introduction()
ink rgb(255,255,255),1
print "HI and welcome!"
print "Press a key"
sync : sync
suspend for key
endfunction
Function GetUserName()
print "first we need to know you name"
input "", PlayersName$
print "Fine " + PlayersName$ + " not so long time ago we get this message"
print "press any key to read the message"
endfunction
function MissionObjectives()
print "Ha Ha HA "
print "i hear that there is a new bomb man on the team now...."
print "i always seek challenge and i want to see how good he is.."
print "send him to the old warehouse"
print "i have a bomb down here"
print "but.. dont worry i will let the new guy play around whit the bomb"
print "and there will not be enemys down there cus he is a newbie"
print "if he dont show up...... i blow the warehouse"
print "i will like to call this a training cus there is no people"
print "there can get hurt..... ofcourse the new man can... if he dont good enough.."
print "p.s i HOPE he show up.."
print "press any key to destroy the message"
sync
suspend for key
cls
endfunction
function Mission()
do
text 10,10,"now i will ask you "Will you take this mission?""
text 10,35,"press y for yes or n for no"
rem yes
if scancode()=21 then DiffuseBomb()
rem no
if scancode()=49 then QuitMission()
sync
loop
cls
endfunction
Function DiffuseBomb()
wait 500
cls
print "GOOD"
print "now lets go!"
print "okay now we here"
print "now try to disarm the bomb"
print "okay there is no time on the bomb... so.. well... that is good!"
print "okay here is the instructions:"
print "press a for red cable. press s for green cable. press d for blue cable"
print "there is 1 changes out for 3 that you will win.."
print "but if you pick the wrong cable......... im sure you know what happen"
print "okay no more talk from me GOOD LUCK!"
print "press any key to start"
sync
suspend for key
cls
do
text 10,10,"Choose Red / Blue or Green Wire"
text 10,35,"press R G or B"
if inkey$() = "r" then CheckBomb(1)
if inkey$() = "g" then CheckBomb(2)
if inkey$() = "b" then CheckBomb(3)
sync
loop
cls
endfunction
Function CheckBomb(guess)
cls
print "you try to diffuse the bomb and......"
sync
wait 1000
if guess = BombCode(1)
cls
Print "You Disarmed the Bomb!"
Print "Press a key"
sync
suspend for key
WinnerScreen()
endif
if guess <> BombCode(1)
cls
Print "The Bomb EXPLODES!!! KABOOOOOOOOOOM"
Print "The BombCode was "+STR$(BombCode(1))
Print "press a key"
sync
suspend for key
LoserScreen()
endif
endfunction
Function QuitMission()
wait 500
cls
print "okay we will get someone else you pussy"
print "press any key to exit mission"
sync
suspend for key
Credits()
endfunction
Function WinnerScreen()
print "YOU WIN!!!!!!!!!!!!!"
print "Press a key to continue"
sync
suspend for key
Credits()
endfunction
Function LoserScreen()
print "YOU LOSE!!!!!!!!!!!!!"
print "Press a key to continue"
sync
suspend for key
EndProgram()
endfunction
Function Credits()
print "credits : The Nerd"
print "Press a key to exit"
sync
suspend for key
EndProgram()
endfunction
Function EndProgram()
rem Terminate Program and cleanup variables and media used.
undim BombCode(1)
end
endfunction
If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself