Hello stackoverflow community! First of all, this is my first post, and I'm not too good with technical terms so excuse any mistakes or things of the sort in this post.
I'm making a text-based adventure game in Batch, and I'm currently working on a small segment of it. For the life of me, I just cannot figure out how to do IF / ELSE statements. I've tried nested conditions, with no success. Here is what I have:
echo You step up to the light. Luckily, it's pretty dim,
echo so you're not burning your corneas.
echo:
echo What would you like to do?
echo:
echo 1] Attempt to fix the light
echo 2] Go back to do something else
echo:
set /p decision=I want to...
if "%decision%"=="2" goto restartStartNoLightFix
if "%decision%"=="1" goto
echo That choice is invalid.
ping localhost -n 4 >nul
goto inspectFlickerLight
@echo is off.
I want if "%decision%"=="1" to be followed by checking if the player has the part to fix the light. Nested conditions were a failure, as said, and since this will be a full blown game it seems that using a goto checkvariable will crowd up with each decision I use. Also, decision is a constantly changing variable, if that will affect anything.
I appreciate any help with this!
Aucun commentaire:
Enregistrer un commentaire