TGC Codebase Backup



A longer version of the first text based adventure for noobs by Big Man

29th Jul 2005 8:42
Summary

This is a longer version of the original.



Description

Instead of having five answer for the whole thing this time there is five answer for each question, each giving a different out come. - Again there is no media.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `load music "Aphrodit.mid",1
set text size 30
center text 320,20,"Text adventure - Go shopping"
set text size 20
center text 320,70,"choose answer from list and write it in exactly as you see it"
center text 320,200,"Press enter to continue"
suspend for key
1=returnkey()
if returnkey()=1 then cls

rem these few lines of code open the story with some text

print "It is a fine saturday afternoon, the sun is hot and there is a nice breeze in the air."
wait 5000
cls
Print "You decide you need a drink of water but because of a recent drought your taps are empty"
wait 5000
cls

rem the main loop notice the repeat of the list of answers this is so you can
rem see them when you want to
rem I have used a variable called rightanswer to decide whether or not
rem the right answer is given
rem it also has an if then statment this is to say if the user types in ???
rem then goto a certain subfunction.
do
start:
center text 320,80,"here is a list of answers"
center text 320,130,"bash the tap and hope water comes out"
center text 320,160,"buy some water"
center text 320,190,"suck on a rock"
center text 320,220,"ignore it and get on with life"
center text 320,250,"roll around on the grass like a lunatic"
input "What should you do: ",a$
if a$="buy some water" then goto buy : rightanswer=1
if a$="bash the tap and hope water comes out" then gosub bash : rightanswer=1
if a$="suck on a rock" then gosub suck : rightanswer=1
if a$="ignore it and get on with life" then gosub ignore : rightanswer=1
if a$="roll around on the grass like a lunatic" then gosub lunatic : rightanswer=1
if rightanswer=0 then goto lose



rem this is the start of the sub functions.
buy:
cls
print "Well done"
wait 2000
cls
print "You arrive at the store and buy a bottle of water to quench your thirst"
wait 5000
cls
tum:
print "Your tummy growls at you for food"
wait 3000
cls
center text 320,80,"here is a list of answers"
center text 320,130,"buy some food"
center text 320,160,"eat your foot"
center text 320,190,"eat some grass"
center text 320,220,"pick up the dog turd"
center text 320,250,"go hungry"
input "What do you do: ",b$
if b$="buy some food" then goto food : rightanswer=1
if b$="eat your foot" then gosub foot1 : rightanswer=1
if b$="eat some grass" then gosub grass : rightanswer=1
if b$="pick up the dog turd" then gosub turd1 : rightanswer=1
if b$="go hungry" then rightanswer=0
if rightanswer=0 then goto lose

food:
cls
print "well done"
wait 2000
cls
print "you reach into your pocket and it is empty, with no money you can't buy that ginsters pasty"
wait 5000
cls
eat:
center text 320,80,"here is a list of answers"
center text 320,130,"steal the food"
center text 320,160,"pick up turd"
center text 320,190,"eat your foot"
center text 320,220,"offer to work at shop"
center text 320,250,"eat shop assistant"
input "What now: ",c$
if c$="offer to work at shop" then goto work : rightanswer=1
if c$="steal the food" then gosub steal : rightanswer=1
if c$="pick up turd" then gosub turd2 : rightanswer=1
if c$="eat your foot" then gosub foot2 : rightanswer=1
if c$="eat shop assistant" then gosub assistant : rightanswer=1
if rightanswer=0 then goto lose
end

work:
cls
print "Right again"
wait 2000
cls 
print "You work for two hours and earn your self £7.50 and you are more hungry now than ever"
wait 5000
cls
print "You then notice that ginsters pasties are on special offer two for £5.00"
wait 5000
cls
center text 320,80,"here is a list of answers"
center text 320,190,"no"
center text 320,250,"yes"
input "do you want to buy the pasties: ",d$
if d$="yes" then goto yes : rightanswer=1
if rightanswer=0 then goto no

yes:
cls
print "You buy the two pasties for £5.00 and when you are out of the shop you read the label"
wait 5000
cls
print "and notice that you are allergic to three of the main ingredients"
wait 4000
goto lose

no:
cls
Print "You decide against the pasties and opt for a bag of chips at £2.00 and an ice cream at £1.00"
wait 5000
cls
print "not bad for two hour work"
wait 2000
cls
print "You arrive back at home an go to bed and in the next few hours..."
wait 4000
goto lose

bash:
cls
print "you spend three hours or more bashing the tap for all its worth but to no avail"
wait 5000
cls
print "try something else"
wait 2000
cls
goto start

suck:
cls
print "You suck the rock and endure it's horrible salty taste but it didn't quench your thirst"
wait 5000
cls
print "Try something else"
wait 2000
cls
goto start

ignore:
cls
print "You ignore your thirst for a long period of time but decide it's too much"
wait 4000
cls
print "You decide to try something else"
wait 3000
cls
goto start

lunatic:
cls
print "You roll around on your lawn making really odd noises and your neighbours give you strange looks"
wait 5000
cls
print "You give up its not working, you try something else"
wait 3000
cls
goto start

foot1:
cls
print "you put your foot in your mouth and bite down on it like there is no tommorow but it hurts too much"
wait 5000
cls
print "Try something else"
wait 2000
cls
goto tum

foot2:
cls
print "you put your foot in your mouth and bite down on it like there is no tommorow but it hurts too much"
wait 5000
cls
print "Try something else"
wait 2000
cls
goto eat

grass:
cls
print "You get down on all fours and eat the grass that sprouts up between the craks in the pavement"
wait 5000
cls
print "its not enough try something else"
wait 2000
cls
goto tum

turd1:
cls
Print "YOU WOULDN'T!!! WOULD YOU!!!"
wait 3000
cls
print "You don't and try something else"
wait 3000
cls
goto tum

turd2:
cls
Print "YOU WOULDN'T!!! WOULD YOU!!!"
wait 3000
cls
print "You don't and try something else"
wait 3000
cls
goto eat

steal:
cls
Print "Now now, we all no that stealing isn,t right"
wait 3500
cls
print "Try something else"
wait 2000
cls
goto eat

assistant:
cls
print "You bite the assistant on the arm and she doesn't appreciate it much"
wait 4000
cls
Print "Try something else"
wait 2000
cls
goto eat


lose:
`stop music 1
cls
print "You die"
end
sync
loop