0
所以最近我花了一段時間製作這個迷你文本遊戲。每次我嘗試運行它時,文件都是從以下方式開始的:戰鬥而不是:開始這真的很煩人,一旦你到達那裏,你甚至不能選擇戰鬥或跑步的選項。請幫忙。並且不要評判比賽。謝謝我的批量遊戲不會開始
@echo off
title: My game!
color 0a
:loop
echo My game!
cls
goto Start
:Start
cls color 3c
echo Hello welcome to my game If this works.....
cls
echo before you start the game make sure that you turned of the hair curler,
echo didnt leave your keys in the car and locked the front door, and THEN you have to make
echo sure that you ARE READY
cls
color 0c
echo WHAT ARE YOU DOING HERE!?!
echo Get out!
color 09
echo A giant monster aproaches you, you dont stop to see what it is chasing you.
color 0c
echo Im gonna demolish you!!
cls
color 09
echo you stop running, the monster is far behind you.You look around and you are in
echo some kind of dungeon
echo then you start to wonder if you could actually try and fight this thing!
cls
color 09
echo Options
echo 1 try and fight this darn thing!
echo 2 keep running
set /p y=
if %% == 1 goto fight
if %% == 2 goto run
:fight
cls
color 09
echo suddenly you find a pocket nife in your cargo jeans! Very conveniant am i right?
echo so you run up to the monster and slay it!
goto scene two
:run
echo youtire quickly and the monster catches up and swiftly kills you
goto GAME OVER
:GAME OVER
wow nice job you managed to die on the first level
echo Options
echo 1 Try again!
echo 2 Be a wuss and quit
set /p y=
if %% == 1 goto Start
if %% == 2 goto quitter
:quitter
cls
color 09
echo Nice job quitter.
:scene two
color 09
echo wow nice job!
echo so far you have done a nice job!
'如果%% == 1'改爲'如果%Y%== 1'(也可用於'2')......這些後'if'行你也應該處理時,用戶輸入的任何其他情況比'1'或'2' ... – aschipfl
'choice/c 12'只允許輸入1或2。見'選擇/?'。測試'如果錯誤級別1不是錯誤級別2回聲1選擇'和'如果錯誤級別2錯誤級別3回顯2選擇'。 – 2016-06-15 00:23:58
感謝那些對我來說很新的東西,當我嘗試運行這個東西的時候,我直接去了:場景二,如果它在代碼中存在錯誤,或者如果我打開它錯誤。 – king1928