Unless peoeple are interested... which they probably won't be but you never know. Maybe i am just being pessimistic, lol.
Anyway! a while ago i started working on a text based adventure. I was very excited (as you always are, when a project starts) and i made a bit of progress but i never really fineshed it and it basically died. Upon finding the amazingly backed up code on my other hard drive (after i formatted the first one) i considered it rather lucky that i didnt lose it (like all my other projects!) so i thought some people might like to see it
Please tell me what you think, i don't think a text-based-adventure needs screenshots exactly... it's the same as every other one lol.
Oh, and it's just a standard dungeon escape, minues ye olde language.
Go through the code if you want to find out all the different commands lol.
I can supply an exe if anyone wants one.
So (finally), here is the code:
REM Project: Text-based-adventure
REM Created: 20/11/2006 7:16:54 p.m.
REM ***** Main Source File *****
set display mode 640,480,32
color backdrop rgb(0,0,0)
progress=-1
startover$="start over"
newgame$="new game"
entercode$="enter code"
controls$="controls"
credits$="credits"
check1$="checkpoint1"
endgame$="exit"
returntomenu$="menu 1"
menuback$="back"
p0_cmd$="pick up bone"
p0_cmd2$="pick up rock"
p0_return$="return"
p1_cmd$="use bone"
p3_cmd$="pick up key"
p4_cmd$="use key"
p5_cmd1$="kill him"
p5_cmd2$="knock him out"
p5_cmd3$="say hi"
p5_cmd4$="give him a hug"
p6_cmd1$="try to punch him"
p6_cmd2$="run back"
p6_cmd3$="kick him in the nuts"
p6_cmd4$="use your jedi mind powers"
p10_cmd1$="kick his nuts again"
p10_cmd2$="punch him in the face"
p10_cmd3$="throw him to the ground"
p10_cmd4$="leave him alone and run back"
p11_cmd1$="use force pull on the wall"
p11_cmd2$="use force push on the guard"
p11_cmd3$="pull out your lightsaber"
`I made the hints in a different place just to make everything aesthetically easier.
`I also made the level codes in a different for the same reason.
p1_lvl$="superbone"
p3_lvl$="boner"
p4_lvl$="youpickedupthekey"
p5_lvl$="achievement unlocked"
p6_lvl$="press L to dispose"
p6_lvl2$="press l to dispose"
p9_lvl$="thats it, run away"
p15_lvl$="i just had a feeling"
do
`Progress ifs
`if progress=0 then newgame()
if progress=-4
wtext(50,60,"Code,Story, and everything made by Peabnuts123. Besides the subnote.",78)
endif
if progress=-3
wtext(50,60,"Controls and Commands",78)
wtext(5,110,"Type menu 1 at any time during the game to return to the main menu",78)
wtext(5,130,"Type start over at any time during the game to start the game over completely",78)
wtext(5,140,"Progress Codes are displayed at the bottom left of any important story section",78)
wtext(5,160,"Type hint on any stage to display hints for some (not all!) of the commands you can use",78)
wtext(5,210,"Type exit at any time to quit the game",78)
endif
if progress=-2
wtext(5,100,"Type in a progress code(displayed on any important story section in the game) and press enter to go to that stage",78)
wtext(50,60,"Progress Code redemption",78)
endif
if progress=-1
wtext(20,60,"Type new game to start a new game",78)
wtext(20,90,"Type enter code to go to progress code redemption screen",78)
wtext(20,120,"Type controls to learn all about the game. Definate must for new users, this is no orginary text based adventure!",78)
wtext(20,180,"Type credits for... you guessed it... credits!",78)
endif
if progress=0
wText(5,100,"You wake to find yourself hanging from the roof a prison cell, bound by your arms. The guards have just left and it appears one of them has dropped a key by the door of your cell. Your feet can barely touch the ground. In your cell is a semi-sharp looking bone, and a rock.",78)
endif
if progress=1
wText(50,60,"Bone picked up",78)
wtext(5,100,"You pick up the bone with your feet and think about the monsterous task ahead of you of using the bone with your feet.",78)
wtext(20,200,"Progress Code: superbone",78)
endif
if progress=2
wtext(5,100,"You shuffle the rock towards you with your feet and realise that the rock is such a useless thing to pick up. What good is a rock going to do you? You put the rock back down and start over. Type start over to start again.",78)
wtext(20,200,"GAME OVER",78)
endif
if progress=3
wtext(5,100,"You use all your wit to use your feet to cut the bonds above your hands. You drop to the ground, and free yourself from the ropes. Standing up and approaching the key you think it's obvious what you're going to do next.",78)
wtext(20,200,"Progress Code: boner",78)
endif
if progress=4
wtext(50,60,"Key picked up",78)
wtext(5,100,"You bend down and pick up the key.",78)
wtext(20,200,"Progress Code: youpickedupthekey",78)
endif
if progress=5
wtext(5,100,"You insert the key into the lock, and turn it, it works! The lock clicks open and you grab the door and open it inwards,silently. You walk out in to the dark hallway and see that the coast is clear. A man comes down the hallway and you quickly melt into the shadows. As he walks past you jump out and...",78)
wtext(20,200,"Progress Code: achievement unlocked",78)
endif
if progress=6
wtext(50,60,"CHECKPOINT! type checkpoint1 to return here if you get GAME OVER.",78)
wtext(5,100,"After disposing of the guards body, and making sure he is dead, you run to the end of the hallway and find another guard weilding a sword. You then...",78)
wtext(20,200,"Progress Code: press L to dispose",78)
endif
if progress=7
wtext(5,100,"You and the guard engage in a pleasent conversation about your lives, you ask if you could please leave but he says no and kills you.",78)
wtext(20,200,"GAME OVER",78)
endif
if progress=8
wtext(5,100,"You launch a solid punch at him and he lunges at you, blocking your punch with his sword, slicing your hand in half. You fall to the ground screaming in pain, bleeding on the ground. The guard raises his sword above his head and slams it down onto your neck.",78)
wtext(20,200,"GAME OVER",78)
endif
if progress=9
wtext(5,100,"You flee from the guard back into the dark hallway and see the dead gaurd's corpse in the corner. You get an idea.",78)
wtext(20,200,"Progress Code: thats it, run away",78)
endif
if progress=10
wtext(5,100,"You kick the guard in the nuts and he stumbles back. While he is in pain against the wall you...",78)
wtext(50,60,"BONUS FIGHT SCENE",78)
endif
if progress=11
wtext(50,60,"BONUS FIGHT SCENE",78)
wtext(5,100,"You focus on the guard flying against the wall and, using the force, you slam his body against the concrete bricks. He staggers up and uses force push on you, you fly into the nearest wall cracking the huge blocks of stone. You force your legs to work as you get up and ...",78)
endif
if progress=12
wtext(50,60,"BONUS FIGHT SCENE",78)
wtext(5,100,"You, being a cruel bastard, kick him in the nuts yet again, the guard winces in extreme pain and buckles over. Suddenly, he stands up and pulls out a steel plate that was protecting his balls. Smirking, he clips it onto his ring and cracks a left hook around your head. The punch sends your world spinning, as stars fill your vision momentarily you feel your head crack against the ground. Dazed you stumble up and...",78)
endif
if progress=13
wtext(50,60,"BONUS FIGHT SCENE",78)
wtext(5,100,"You hold the guard's head back by his hair and slam a powerful uppercut around his face. Blood sprays out of the guards mouth, and splatters on the wall. The guard's leg suddenly shoots out and slams your nuts. You find yourself on your back holding your balls. The guard, with a severe limp, lifts up his leg above your head and brings it down. You quickly...",78)
endif
if progress=14
wtext(50,60,"BONUS FIGHT SCENE",78)
wtext(5,100,"Grabbing the guard by the hair on the back of his head, you throw him to the ground face first. He just avoids a faceplant by slamming his hands onto the ground. He kicks out and connects with the back of your knee, buckling your legs backwards and sending you on a collision course to the earth. You slam to the ground on your back and roll over to avoid any secondary attacks. As you both stagger to your feet, the guard launches an attack at you and you quickly...",78)
endif
if progress=15
wtext(5,100,"You run back to the hallway with the dead guard, you spot his body in the corner and get an idea...",78)
wtext(20,200,"Progress Code: i just had a feeling",78)
endif
if progress=16
wtext(5,100,"You use force pull on the wall beside the guard. A rock slides out of it with force and slams the guard's head against the opposite wall, spraying his brains everywhere. The brick crashes to the fall onto the guards discarded sword, flinging it towards you. It penetrates your skull and kills you, wedging itself between two stones behind your head and thus hanging you from the wall.",78)
wtext(20,200,"GAME OVER",78)
endif
if progress=17
wtext(5,100,"You use force push on the guard and send him flying into the wall, nearly crashing through it. He falls to the ground with a thud. But you know he is not defeated. He slowly stumbles up and pulls out a lightsaber, turning it on. You quickly...",78)
wtext(50,60,"BONUS FIGHT SCENE",78)
endif
if progress=18
wtext(5,100,"You pull out ur lightsaber and turn it on. The guard does the same, as he takes a step back to prepare for the battle ahead.",78)
wtext(50,60,"BONUS FIGHT SCENE",78)
endif
`Basically, this is where the text u type goes.
set cursor 65,5
`Debug purposes
`text 50,50,"say$="+say$
`text 50,70,"bonebout$="+bonebout$
`Obviously, just some text for your viewing pleasure.
text 270,460,"Thanks to Benzoate for text wrapping function"
text 5,5,"Command:"
`The super important command
input " ", say$
`Commands controlling what happens when u type stuff
if progress=0 and say$=p0_cmd$
`bonebreakout()
progress=1
endif
if progress=1 and say$=p1_cmd$
progress=3
endif
if progress=2 and say$=p0_return$ then progress=0
if progress=0 and say$=p0_cmd2$
progress=2
endif
if say$=startover$ then progress=0
if say$=endgame$ then goto endgame
if say$=returntomenu$ then progress=-1
if progress<-1 and say$=menuback$ then progress=-1
if progress=-1 and say$=newgame$ then progress=0
if progress=-1 and say$=entercode$ then progress=-2
if progress=-1 and say$=controls$ then progress=-3
if progress=-1 and say$=credits$ then progress=-4
if progress>5 and say$=check1$ then progress=6
if progress=3 and say$=p3_cmd$ then progress=4
if progress=4 and say$=p4_cmd$ then progress=5
if progress=5 and say$=p5_cmd1$ then progress=6
if progress=5 and say$=p5_cmd2$ then progress=6
if progress=5 and say$=p5_cmd3$ then progress=7
if progress=5 and say$=p5_cmd4$ then progress=7
if progress=6 and say$=p6_cmd1$ then progress=8
if progress=6 and say$=p6_cmd2$ then progress=9
if progress=6 and say$=p6_cmd3$ then progress=10
if progress=6 and say$=p6_cmd4$ then progress=11
if progress=10 and say$=p10_cmd1$ then progress=12
if progress=10 and say$=p10_cmd2$ then progress=13
if progress=10 and say$=p10_cmd3$ then progress=14
if progress=10 and say$=p10_cmd4$ then progress=15
if progress=11 and say$=p11_cmd1$ then progress=16
if progress=11 and say$=p11_cmd2$ then progress=17
if progress=11 and say$=p11_cmd3$ then progress=18
`i made the entercode ifs in another section since there'd be a lot of them and it would have gotten confusing having it with all the rest of them
if progress=-2 and say$=p1_lvl$ then progress=1
if progress=-2 and say$=p3_lvl$ then progress=3
if progress=-2 and say$=p4_lvl$ then progress=4
if progress=-2 and say$=p5_lvl$ then progress=5
if progress=-2 and say$=p6_lvl$ then progress=6
if progress=-2 and say$=p6_lvl2$ then progress=6
if progress=-2 and say$=p9_lvl$ then progress=9
if progress=-2 and say$=p15_lvl$ then progress=15
`I dont even know if i need this lol
sync
`The even more super important command,lol, and it's only 3 letters long X-D
cls
loop
`Functions for the text wrapping commands, and the control for every "level" of the game. And other stuff
function wText(x#, y#, s$, length#)
if len(s$) < length#
text x#, y#, s$
s$=""
endif
wcount=1
while len(s$) > length#
wtextT$ = left$(s$, length#)
s$ = right$(s$, len(s$)-length#)
text x#, y#+text height(s$)*wcount, wTextT$
wcount=wcount+1
endwhile
text x#, y#+text height(s$)*wcount, s$
x#=0
y#=0
s$=""
length#=0
endfunction
function newgame()
progress=0
endfunction
function Originalcell()
wText(5,100,"You wake to find yourself hanging from the roof a prison cell, bound by your arms. The guards have just left and it appears one of them has dropped a key by the door of your cell. Your feet can barely touch the ground. In your cell is a semi-sharp looking bone, and a rock.",78)
endfunction
function bonebreakout()
wText(50,90,"Bone picked up",78)
progress=1
endfunction
endgame:
exit
it works as far as i know! (hah!) Sorry the code is so bloody messy.