sorry for the double post....but I have found myself slightly stuck....can someone please look at my coding and help me see what's wrong?
The problem is, after finding a key in desk1, the game instantly goes to the subroutine first_door
Rem Project: Awaken
Rem Created: 22/09/2006 15:22:30
Rem ***** Main Source File *****
`*********************************
`***********MAIN LOOP*************
`*********************************
`clear screen
cls
load music "022 - Ill Kill You.mp3",1
load music "026 - BlackFairy.mp3", 2
load music "004 - Until Death.mp3", 3
load music "016 - Moonchild.mp3", 4
load sound "STEELYEC.WAV",1
`go to the subroutine "Wakeup"
gosub wake_up
`swt the text to appear at the top of the screen
set cursor 0,0
`draws screen
sync
`waits for key to be pressed
suspend for key
if gameover = 1 then gosub game_over
`********************************
`**********Main Loop End*********
`********************************
`-------------
`wake_up
`-------------
wake_up:
center text 500,225, "THIS IS A TEXT BASED GAME, WHEN TYPING COMMANDS, ALWAYS USE LOWER CASE!!!"
wait key
center text 500,270, "A Kenomica Game...."
wait key
set text size 50
center text 500,300, "AWAKEN!"
set text size 25
wait key
cls
play music 1
print "You wake up in an extremely strange place, you are shackled to a wall by your wrists."
wait key
print "You are extremely cold, you hardly remember your own name...in fact;"
wait key
input "What Is Your name? ",Name$
print Name$,", of course it is, how could you forget."
wait key
print "Why are you here...shackled to the wall, who is behind this. You must escape."
wait key
print "The room you are in is almost pitch black, you can smell damp in the air."
wait key
print "You are wearing ragged, worn out clothes. are they yours?"
wait key
print "you must escape, think...."
wait key
print "Something catches your eye...."
wait key
print "You pick up a large, sturdy, rock with what room you have."
wait key
print "This is all you're tired eyes can focus."
wait key
print "you are scared and cannot see...you hold a rock in your hand.."
wait key
print "you hope...in all desperation, it may be of some use"
wait key
action=0
while action=0
input "what do you want to do with it?", word$
if left$(word$, 5) = "throw"
if right$ (word$, 4) = "rock" then gosub throw_rock : action = 1
if right$ (word$, 5) = "stone" then gosub throw_rock : action = 1
if right$ (word$, 4) = "away" then gosub throw_rock : action = 1
endif
if left$(word$, 5) = "break"
if right$ (word$, 5) = "chain" then gosub break_shackle : action = 1
if right$ (word$, 6) = "chains" then gosub break_shackle : action = 1
if right$ (word$, 7) = "shackle" then gosub break_shackle : action = 1
if right$ (word$, 8) = "shackles" then gosub break_shackle : action = 1
if right$ (word$, 4) = "free" then gosub break_shackle : action = 1
endif
if action=0
print "You must be too confused...."
endif
endwhile
wait key
return
`----------
`throw_rock
`----------
throw_rock:
cls
print "You have thrown the rock...the only thing you had."
wait key
print "several hours have passed."
wait key
cls
gosub game_over
`-------------
`break_shackle
`-------------
break_shackle:
play sound 1
print "You use the rock to try and break free of your shackles."
wait key
play sound 1
print "the blunt rock illuminates the dark room as it sparks on the cold metal restraining your hands."
wait key
print "Yes...you're free...you can finally get out of this place..."
play sound 1
wait key
print name$, ", why is this happening to you....what could you have possibly done to deserve this..."
wait key
print "You stand up, feeling the bruises on your face."
wait key
print "The room comes slowly in to focus as you wipe the mixture of sweat and blood from your eyes."
wait key
print "In the distance is a door...it's battered and old."
wait key
print "Also in view is a desk of drawers."
wait key
action=0
while action=0
input "what would you like to do?", word$
if left$ (word$, 5)= "enter"
if right$ (word$, 4) = "door" then gosub first_door : action=1
endif
if left$ (word$, 5)= "go"
if right$ (word$, 4) = "door" then gosub first_door : action=1
endif
if left$ (word$, 6) = "search"
if right$ (word$, 6) = "drawer" then gosub desk1 : action=1
if right$ (word$, 7) = "drawers" then gosub desk1 : action=1
if right$ (word$, 4) = "desk" then gosub desk1 : action=1
endif
if left$ (word$, 6) = "search"
if right$ (word$, 6) = "drawer" then gosub desk1 : action=1
if right$ (word$, 7) = "drawers" then gosub desk1 : action=1
if right$ (word$, 4) = "desk" then gosub desk1 : action=1
endif
if action=0
print "you must not be thinking straight...."
endif
endwhile
`----------
`first_door
`----------
first_door:
if nSmallkey=1
wait key
print "You have unlocked the door."
wait key
gosub up_stairs
else
print "You attempt to open the door."
wait key
print "It is locked..."
endif
return
`-----
`desk1
`-----
desk1:
if nSmallkey=1
print "You search again with a hope of finding something else."
wait key
print "There is nothing more...."
return
else
wait key
print "You search the desk, hoping to find something of use."
wait key
print "yes, you have found a small key, thank God!" : nSmallkey=1
return
endif
RETURN
`---------
`up_stairs
`---------
up_stairs:
print "iyur"
wait key
`-----------
`game_over
`-----------
game_over:
cls
print "Your vision is blurry, everything is dimming out. You feel your body going cold...Your adventure ends here."
wait key
set text size 64
center text 500,225, "GAME OVER"
wait key
set text size 20
return