vendredi 27 janvier 2017

Batch. Trying to make text adventure, if else not working

i am trying to make a text adventure, but i'm kind of clueless how to get an if/else statement to work with a variable. probably a few mistakes in my code:

@ echo off

color 0a

echo This is a text adventure! to play, read through the story and at certain points you get to make decisions.

echo Remember, selecting an invalid option will automatically be counted as option 2!

echo have fun

pause

cls

echo You wake up in a dimly lit room. You can't seem to remember anything. Anything about you or how you got here, that is.

echo You walk towards the door. It is locked.

echo 1)Force the door open.

echo 2) look around for another means of escape.

set /p escape=

if %escape% = 1

cls 
echo you get the door open, but an orc comes in and smashes your face.

echo get rekt buddy, game over.

pause

exit
else

goto dungeon


:dungeon

cls

echo well done.

pause

exit

Aucun commentaire:

Enregistrer un commentaire