|
Answer» Hello all! I am new to these forums, and I thought this would be a great introduction for both parties. I am creating a text-based adventure game as a .bat file, just for fun, and would like to share. I am looking for constructive criticism and advice, as I hope that this little project gives me a more advanced knowledge of .bat scripting.
Here's what I have so far:
ECHO off title Adventure Game
set manRoomVal= 0
:manRoom echo; echo Your BASIC controls are: echo Enter L for Left echo Enter R for Right echo Enter F for Forward echo Enter B for Backward echo Enter S for Search echo Enter H for Hear/Listen if %manRoomVal% EQU 1 goto mainRoom if %manRoomVal% EQU 0 goto introduction
:introduction set manRoomVal= 1 echo; echo You are standing in a cold hallway, wielding a gun. You're sweating and you don't recall much. echo There is a door infront of you, a desk to the left, a dark opening to a CORRIDOR behind you, and nothing to your right. What do you do? set mainRoomLeftVal= 0 set mainRoomSearchVal= 0 set mainRoomHearVal= 0 set mainRoomRightVal= 0 goto mainRoom
:mainRoom echo; set /p directionChoice= What will you do? if %directionChoice% EQU L goto mainRoomLeft if %directionChoice% EQU R goto mainRoomRight if %directionChoice% EQU F goto mainRoomForward if %directionChoice% EQU B goto mainRoomBackward if %directionChoice% EQU S goto mainRoomSearch if %directionChoice% EQU H goto mainRoomHear if %directionChoice% EQU man goto manRoom pause
:rejectionRoom echo; echo You've already done this! goto mainRoom
:mainRoomLeft if %mainRoomLeftVal% EQU 1 goto rejectionRoom if %mainRoomLeftVal% EQU 0 echo; echo You turn left and move towards the desk. You look it over. There some papers on it, and perhaps something in the drawer... echo; set /p deskChoice= (S)earch it or (L)eave it and turn back the way you were facing before? if %deskChoice% EQU S goto deskSearch if %deskChoice% EQU L goto mainRoom
:deskSearch echo; echo You examine the paperwork on the TOP of the desk more closely. It's all very official looking; long writing files with drab words. echo You can't seem to focus on everything it says.. echo You open the drawer hoping something jumps out of at you in there. echo There's another gun in there, as well as a set of keys, and a pack of cigarettes. echo You pocket it all and then move back to the spot you were standing at before. echo; set mainRoomLeftVal= 1 goto mainRoom
:mainRoomRight if %mainRoomRightVal% EQU 1 goto rejectionRoom if %mainRoomRIghtVal% EQU 0 echo; echo You turn to your right to move but there is nothing there besides a dull wall. set mainRoomRightVal= 1 goto mainRoom
:mainRoomSearch if %mainRoomSearchVal% EQU 1 goto rejectionRoom if %mainRoomSearchVal% EQU 0 echo; echo Frantically you try to look around the room and process everything. Your heart is beating so fast and your pupils are dancing with each beat. echo You notice the walls are cold gray tile, kind of modern looking. There is a fading flourescent light fixture about your head. echo There's nothing on the floor except garbage. echo There's blood on your clothes.. Why is there blood on your clothes? echo; set mainRoomSearchVal= 1 goto mainRoom
:mainRoomHear if %mainRoomHearVal% EQU 1 goto rejectionRoom if %mainRoomHearVal% EQU 0 echo; echo You try to listen to the noises of the room. It is difficult. Your heart is beating fast and heavily. You also hear yourself breathing. echo A break in your body's noises let's you hear something deep and familiar in the distance.. Metal on metal.. tunneling through.. echo That's train noise. echo; set mainRoomHearVal= 1 goto mainRoom
:mainRoomBackward echo backward pause
:mainRoomForward echo forward pause
The end, so far. Please tell me what you all think and offer any advice/tips you can! -Tim I see you didn't take any of our advice on the dostips.com forum because I do not see any code changes. http://www.dostips.com/forum/viewtopic.php?f=3&t=5648
|