Derp Craft batch game
Posted: 02 May 2013 20:04
I've been coding for a few weeks now and I was wondering if someone could help me with a code.
I am currently trying to make a Text-Based Minecraft sorta thingy. I can't figure out how to make it so when you chop a tree it gives you wood and then the wood goes and adds to the Inventory Screen. If anyone could tell me what I am doing wrong I would appreciate it.
@echo off
TITLE Derp Craft
color 02
:Menu
cls
echo Derp Craft v0.1
echo ----------------
echo 1. Play
echo 2. Info
echo 3. Exit
set /p MENU=
if %MENU%==1 goto Play
if %MENU%==2 goto Info
if %MENU%==3 exit
if not %MENU%==1 goto Invalid
if not %MENU%==2 goto Invalid
if not %MENU%==3 goto Invalid
:Play
set wood=0
set rock=0
set coal=0
set diamond=0
set planks=0
set food=0
cls
echo What is your name?
set /p NAME=
echo Hello %NAME%, Welcome to Derp Craft v0.1!
pause >nul
goto Play2
:Play2
cls
echo Derp Craft v0.1
echo ----------------
echo Wood:%wood% Planks:%planks%
echo Stone:%rock% Diamond:%diamond%
echo Coal:%coal% Food:%food%
echo --------------------------
echo 1. Chop Wood
echo 2. Go Mine Stone
echo 3. Go Mine Coal
echo 4. Make Planks
echo 5. Go Diamond Mining
echo 6. Go Hunting
set /p INV=
if %INV%==1 goto Chop
if %INV%==2 goto MineStone
if %INV%==3 goto MineCoal
if %INV%==4 goto Planks
if %INV%==5 goto Diamonds
if %INV%==6 goto Hunting
if not %INV%==1 goto Invalid
if not %INV%==2 goto Invalid
if not %INV%==3 goto Invalid
if not %INV%==4 goto Invalid
if not %INV%==5 goto Invalid
if not %INV%==6 goto Invalid
:Invalid
cls
echo You entered a wrong number!
pause >nul
goto Play2
:Chop
set woodchop=8
cls
echo You go out and chop some wood.
echo You return with %woodchop% Wood.
set %wood% + %woodchop% = %wood% <----How Do I Write This Statement Correctly?
pause >nul
goto Play2
I am currently trying to make a Text-Based Minecraft sorta thingy. I can't figure out how to make it so when you chop a tree it gives you wood and then the wood goes and adds to the Inventory Screen. If anyone could tell me what I am doing wrong I would appreciate it.
@echo off
TITLE Derp Craft
color 02
:Menu
cls
echo Derp Craft v0.1
echo ----------------
echo 1. Play
echo 2. Info
echo 3. Exit
set /p MENU=
if %MENU%==1 goto Play
if %MENU%==2 goto Info
if %MENU%==3 exit
if not %MENU%==1 goto Invalid
if not %MENU%==2 goto Invalid
if not %MENU%==3 goto Invalid
:Play
set wood=0
set rock=0
set coal=0
set diamond=0
set planks=0
set food=0
cls
echo What is your name?
set /p NAME=
echo Hello %NAME%, Welcome to Derp Craft v0.1!
pause >nul
goto Play2
:Play2
cls
echo Derp Craft v0.1
echo ----------------
echo Wood:%wood% Planks:%planks%
echo Stone:%rock% Diamond:%diamond%
echo Coal:%coal% Food:%food%
echo --------------------------
echo 1. Chop Wood
echo 2. Go Mine Stone
echo 3. Go Mine Coal
echo 4. Make Planks
echo 5. Go Diamond Mining
echo 6. Go Hunting
set /p INV=
if %INV%==1 goto Chop
if %INV%==2 goto MineStone
if %INV%==3 goto MineCoal
if %INV%==4 goto Planks
if %INV%==5 goto Diamonds
if %INV%==6 goto Hunting
if not %INV%==1 goto Invalid
if not %INV%==2 goto Invalid
if not %INV%==3 goto Invalid
if not %INV%==4 goto Invalid
if not %INV%==5 goto Invalid
if not %INV%==6 goto Invalid
:Invalid
cls
echo You entered a wrong number!
pause >nul
goto Play2
:Chop
set woodchop=8
cls
echo You go out and chop some wood.
echo You return with %woodchop% Wood.
set %wood% + %woodchop% = %wood% <----How Do I Write This Statement Correctly?
pause >nul
goto Play2