基本上,我一直在研究一个可以创建世界的游戏。这是非常新的,我一直在研究它约30分钟。第三方外部程序是cmdmenusel和选择。在岩石场景中,(:岩石),当我单击"展开"时,它会以快速消息崩溃。您能帮我看看我的代码怎么了吗?
@echo off
title Develop a World
cd z
:: Not a fully developed program.
:: Do not distribute.
:: (C) Copyright Bextem 2016 - Present
:love
cls
color D
echo There is nothing but love.
cmdMenuSel f870 "Grow"
if %ERRORLEVEL% == 1 goto hope
goto love
:hope
cls
color E
echo There is love and hope.
cmdMenuSel f870 "Grow"
if %ERRORLEVEL% == 1 goto start
goto hope
:start
cls
color F
echo With love and hope, there is a start.
cmdMenuSel f870 "Grow"
if %ERRORLEVEL% == 1 goto rocks
goto start
:rocks
cls
color 8
echo There are rocks in your land.
cmdMenuSel f870 "Grow"
if %ERRORLEVEL% == 1 goto mountain
goto rocks
:mountains
cls
color 8
echo There is a mountain.
echo.
type mountain.txt
echo.
cmdMenuSel f870 "Expand"
if %ERRORLEVEL% == 1 goto manymts
goto mountains
:manymts
cls
color 8
echo There are caves and mountains.
echo.
type mt.txt
cmdMenuSel f870 "Crumble" "Grow"
if %ERRORLEVEL% == 1 goto earth
if %ERRORLEVEL% == 2 goto stone
goto manymts
:stone
echo There is nothing but stone.
echo Press any key to undo your mistake.
pause >nul
goto manymts
:earth
cls
color 6
echo There is dirt and mountains.
cmdMenuSel f870 "Water" "Shine"
if %ERRORLEVEL% == 1 goto earthwater
if %ERRORLEVEL% == 2 goto earthshine
goto earth
:earthwater
cls
color 61
echo There is moist soil and mountains.
cmdMenuSel f870 "Shine" "Water"
if %ERRORLEVEL% == 1 goto earthwatershine
if %ERRORLEVEL% == 2 goto floodearth1
goto earthwater
:earthshine
cls
color 16
echo There is hot soil and mountains.
cmdMenuSel f870 "Water" "Shine"
if %ERRORLEVEL% == 1 goto earthwatershine
if %ERRORLEVEL% == 2 goto droughtearth1
goto earthshine
:floodearth1
cls
color 2
echo Your world has flooded.
echo Press any key to undo your mistake.
pause >nul
goto earthwater
:droughtearth2
cls
color 6
echo The world burns from the sun.
echo Press any key to undo your mistake.
pause >nul
goto earthshine
:earthwatershine
cls
color A2
echo The soil is floroushing.
cmdMenuSel f870 "Grow" "Plant"
if %ERRORLEVEL% == 1 goto dirtpile
goto earthwatershine
:dirtpile
cls
color 6
echo There is a pile of dirt and mountains
echo +1 more.
cmdMenuSel f870 "Grow Dirt" "Grow Mountains" "Inventory"
if %ERRORLEVEL% == 1 goto dirtpilehuge
if %ERRORLEVEL% == 2 goto stone
if %ERRORLEVEL% == 3 goto Inventory
goto dirtpile
:Inventory
echo PLAYER'S INVENTORY (PAGE 1)
echo You have:
echo Loves: %love%
echo Hopes: %hope%
echo Starts: %start%
echo Rocks: %rocks%
echo Mountains: %mountains%
echo Caves: %caves%
echo Soil: %soil%
:startgame
set love=0
set hope=0
set start=0
set rocks=0
set mountain=0
set caves=0
set soil=0
set humans=0
goto love
您在:rocks
节中有goto mountain
而不是goto mountains
。
看着那件事只有两行以查看您的错字。代码中的任何地方都没有:mountain
。仅:mountains
。
因此,只需更改:
if %ERRORLEVEL% == 1 goto mountain
.. to:
if %ERRORLEVEL% == 1 goto mountains