Batch File Dragon Game

19,580

4

6

How to make a BATCH FILE DRAGON GAME

I HAVE AN UPDATED VERSION ON THIS GAME:

https://www.instructables.com/id/Batch-File-Dragon-...

  1. Press Start
  2. Type in notepad
  3. In notepad Copy and Paste the code below:
  4. In the top right of notepad click File
  5. Then click Save As
  6. IMPORTANT: Name the file DragonKill.bat
  7. Then Click the drop down menu below that says Text Document
  8. Change it to All Files
  9. Click save
  10. Then go to your windows explorer (the file folder icon) then open up the game!
  11. ENJOY =)
@echo off

:menu
color 0a
cls
echo DRAGON KILL
echo Choose the number:
echo 1. Start game
echo 2. Exit
set /p menu=
if '%menu%'=='1' (
goto sets
)
if '%menu%'=='2' (
exit
)else goto menu
:sets
cls
set /a money=1000
set /a health=1000
set /a potions=0
set /a damage=2
set /a dd=5
set /a dh=25
set /a moneygain=50
set /a levels=0
set /a new=%dh%+5
:start
cls
echo Money:%money%
echo Health:%health%
echo Number of healing potions:%potions%
echo Choose the number:
echo 1. Venture onward to the dragon
echo 2. Go to Store
echo 3. Go to Title screen
echo 4. Drink heal potion
set /p choose=
if '%choose%'=='1' (
cls
echo DO NOT HOLD THE ENTER KEY
pause
goto fight
)
if '%choose%'=='2' (
goto store
)
if '%choose%'=='3' (
goto menu
)
if '%choose%'=='4' (
goto nextx
)else goto start
:fight
cls
echo Health:%health%
echo Dragon's Health:%new%
echo You have encountered a dragon
pause
cls
echo Press enter to hit the dragon
set /p hit=
set /a new=%new%-%damage%
if %new% LSS 1 (
goto defeat
)
cls
echo Health:%health%
echo Dragon's Health:%new%
echo You have hit the dragon
echo The dragon lost %damage% health
pause
cls
echo The dragon has hit you!
set /a health=%health%-%dd%
if %health% LSS 1 (
goto defeated
)
pause
cls
goto fight
:defeat
cls
set /a dh=%dh%+20
set /a new=%dh%
set /a money=%money%+15
set /a levels=%levels%+1
echo You defeated the dragon and earned $15.
echo Congratz
pause
goto start
:defeated
cls
echo Sorry You died!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo RIP
echo You have killed %levels% dragon
pause
goto menu
:store
cls
echo Money:%money%
echo Welcome to the store!
echo Choose:
echo 1.Sword Upgrade	$700
echo 2.Heal Potion	$30
echo 3.Leave Store
set /p again=
if %again%==1 (
goto buysword
)
if %again%==2 (
goto buyheal
)
if %again%==3 (
goto start
)else goto store</p><p>:buysword
cls
set /a money=%money%-700
if %money% LSS 0 (
echo You cant buy that!
set /a money=%money%+700
pause
goto store
)else (
set /a damage=%damage%+4
echo You have upgraded your sword
pause
goto store
)
:buyheal
cls
set /a money=%money%-30
if %money% LSS 0 (
echo You cant buy that!
set /a money=%money%+30
pause
goto store
)else (
set /a potions=%potions%+1
echo You have bought one heal potion
pause
goto store
)
:nextx
cls
if %potions%==0 (
echo Sorry. You dont have any potions.
pause
goto start
)else (
set /a health=%health%+15
set /a potions=%potions%-1
echo You have used one potion
pause
goto start
)

Share

    Recommendations

    • Pets Challenge

      Pets Challenge
    • Classroom Science Contest

      Classroom Science Contest
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    6 Discussions

    0
    None
    brotherscool123

    2 months ago

    OKAY! So this now has armor, random number values, usable levels, and SAVE AND LOAD FEATURES!!!


    @echo off
    :menu
    color 40
    cls
    echo Dragon Slayer!!!
    echo Choose the number:
    echo 1. Start game
    echo 2. Exit
    choice /c:12 /n > nul
    if errorlevel 2 goto exit
    if errorlevel 1 goto sets
    :sets
    cls
    set /a money=1500
    set /a health=1000
    set /a potions=1
    set /a damage=5
    set /a armor=5
    set /a dd=5+%level%+%random%%% 5 +15
    set /a dh=25
    set /a moneygain=50
    set /a levels=0
    set /a new=%dh%+5
    goto start
    :start
    cls
    echo Money:%money%
    echo Health:%health%
    echo Damage:%damage%
    echo Armor:%armor%
    echo Level:%levels%
    echo Number of healing potions:%potions%
    echo Choose the number:
    echo 1. Venture onward to the dragon
    echo 2. Go to Store
    echo 3. Go to Title screen
    echo 4. Drink heal potion
    echo 5. Save
    Echo 6. Load
    choice /c:123456 /n > nul
    if errorlevel 6 goto load
    if errorlevel 5 goto save
    if errorlevel 4 goto nextx
    if errorlevel 3 goto menu
    if errorlevel 2 goto store
    if errorlevel 1 goto fight
    :fight
    cls
    echo Health:%health%
    echo Dragon's Health:%new%
    echo You have encountered a dragon
    pause
    cls
    echo Press enter to hit the dragon
    set /p hit=
    set /a new=%new%-%damage%
    if %new% LSS 1 (
    goto defeat
    )
    cls
    echo Health:%health%
    echo Dragon's Health:%new%
    echo You have hit the dragon
    echo The dragon lost %damage% health
    pause
    cls
    echo The dragon has hit you!
    set /a health=%health%-%dd%/%armor%
    if %health% LSS 1 (
    goto defeated
    )
    pause
    cls
    goto fight
    :defeat
    cls
    set /a dh=%dh%+%random%%% 5 +100
    set /a new=%dh%
    set /a money=%money%+%level%+%random%%% 100 +160
    set /a levels=%levels%+1
    echo You defeated the dragon and earned gold.
    echo Congratz
    pause
    goto start
    :defeated
    cls
    echo Sorry You died!
    echo RIP
    echo You have killed %levels% dragon
    pause
    goto menu
    :store
    cls
    echo Money:%money%
    echo Welcome to the store!
    echo Choose:
    echo 1.Sword Upgrade$500
    echo 2.Armor Upgrade$1500
    echo 3.Heal Potion$10
    echo 4.Leave Store
    choice /c:1234 /n > nul
    if errorlevel 4 goto start
    if errorlevel 3 goto buyheal
    if errorlevel 2 goto buyarmor
    if errorlevel 1 goto buysword
    :buysword
    cls
    set /a money=%money%-500
    if %money% LSS 0 (
    echo You cant buy that!
    set /a money=%money%+500
    pause
    goto store
    )else (
    set /a damage=%damage%+10
    echo You have upgraded your sword
    pause
    goto store
    )
    :buyarmor
    cls
    set /a money=%money%-1500
    if %money% LSS 0 (
    echo You cant buy that!
    set /a money=%money%+1500
    pause
    goto store
    )else (
    set /a armor=%armor%+10
    echo You have upgraded your armor
    pause
    goto store
    )
    :buyheal
    cls
    set /a money=%money%-10
    if %money% LSS 0 (
    echo You cant buy that!
    set /a money=%money%+10
    pause
    goto store
    )else (
    set /a potions=%potions%+1
    echo You have bought one heal potion
    pause
    goto store
    )
    :nextx
    cls
    if %potions%==0 (
    echo Sorry. You dont have any potions.
    pause
    goto start
    )else (
    set /a health=%health%%+30 +10
    set /a potions=%potions%-1
    echo You have used one potion and gained 30 health
    pause
    goto start
    )
    :save
    cls
    (
    echo Money:%money%
    echo Health:%health%
    echo Damage:%damage%
    echo Armor:%armor%
    echo Level:%levels%
    echo DragonHealth:%dh%
    echo Number of healing potions:%potions%
    ) > savegame.sav
    echo Press enter to continue
    pause
    goto start
    :load
    cls
    < savegame.sav (
    set /p Money=%money%
    set /p Health=%health%
    set /p Damage=%damage%
    set /p Armor=%money%
    set /p Levels=%levels%
    set /p DragonHealth=%dh%
    )
    echo Press enter to continue
    pause
    goto start

    0
    None
    ArbabB1

    1 year ago

    i made this by making some changes on this script copy this and make a new .bat file

    @echo off

    :menu

    color 0c

    cls

    echo DRAGON KILL

    echo Choose the number:

    echo 1. Start game

    echo 2. Exit

    echo Made By Arbab

    set /p menu=

    if '%menu%'=='1' (

    goto sets

    )

    if '%menu%'=='2' (

    exit

    )else goto menu

    :sets

    cls

    set /a money=1000

    set /a health=1000

    set /a potions=0

    set /a damage=2

    set /a dd=5

    set /a dh=25

    set /a moneygain=50

    set /a levels=0

    set /a new=%dh%+5

    :start

    cls

    echo Money:%money%

    echo Health:%health%

    echo Number of healing potions:%potions%

    echo Choose the number:

    echo 1. Venture onward to the dragon

    echo 2. Go to Store

    echo 3. Go to Title screen

    echo 4. Drink heal potion

    set /p choose=

    if '%choose%'=='1' (

    goto fight

    )

    if '%choose%'=='2' (

    goto store

    )

    if '%choose%'=='3' (

    goto menu

    )

    if '%choose%'=='4' (

    goto nextx

    )else goto start

    :fight

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have encountered a dragon

    pause

    cls

    echo Press enter to hit the dragon

    set /p hit=

    set /a new=%new%-%damage%

    if %new% LSS 1 (

    goto defeat

    )

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have hit the dragon

    echo The dragon lost %damage% health

    pause

    cls

    echo The dragon has hit you!

    set /a health=%health%-%dd%

    if %health% LSS 1 (

    goto defeated

    )

    pause

    cls

    goto fight

    :defeat

    cls

    set /a dh=%dh%+20

    set /a new=%dh%

    set /a money=%money%+50

    set /a levels=%levels%+1

    echo You defeated the dragon and earned $50.

    echo Congratz

    ping localhost -n 5 >nul

    pause

    goto start

    :defeated

    cls

    echo Sorry You died!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    echo RIP

    echo You have killed %levels% dragons

    ping localhost -n 5 >nul

    pause

    goto menu

    :store

    cls

    echo Money:%money%

    echo Welcome to the store!

    echo Choose:

    echo 1.Sword Upgrade$700

    echo 2.Heal Potion$30

    echo 3.Leave Store

    set /p again=

    if %again%==1 (

    goto buysword

    )

    if %again%==2 (

    goto buyheal

    )

    if %again%==3 (

    goto start

    )else goto store

    :buysword

    cls

    set /a money=%money%-700

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+700

    pause

    goto store

    )else (

    set /a damage=%damage%+4

    echo You have upgraded your sword

    pause

    goto store

    )

    :buyheal

    cls

    set /a money=%money%-30

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+30

    pause

    goto store

    )else (

    set /a potions=%potions%+1

    echo You have bought one heal potion

    pause

    goto store

    )

    :nextx

    cls

    if %potions%==0 (

    echo Sorry. You dont have any potions.

    pause

    goto start

    )else (

    set /a health=%health%+15

    set /a potions=%potions%-1

    echo You have used one potion

    pause

    goto start

    )

    thanks!

    0
    None
    DevinS37

    1 year ago

    i have fixed the bugs (all of them) and upgraded it so you stay alive longer. hope you like it!

    p.s. (to the maker) dont use the command: if '%choose%' == 1(goto whatever)

    use: choice /c:123 /n > nul if errorlevel 1 goto whatever

    it is much simpler and will go to wherever you say as soon as you press the number instead of having to press enter

    @echo off

    :menu

    color 0a

    cls

    echo DRAGON KILL

    echo Choose the number:

    echo 1. Start game

    echo 2. Exit

    choice /c:12 /n > nul

    if errorlevel 2 goto exit

    if errorlevel 1 goto sets

    :sets

    cls

    set /a money=1500

    set /a health=1000

    set /a potions=1

    set /a damage=5

    set /a dd=5

    set /a dh=25

    set /a moneygain=50

    set /a levels=0

    set /a new=%dh%+5

    goto start

    :start

    cls

    echo Money:%money%

    echo Health:%health%

    echo Number of healing potions:%potions%

    echo Choose the number:

    echo 1. Venture onward to the dragon

    echo 2. Go to Store

    echo 3. Go to Title screen

    echo 4. Drink heal potion

    choice /c:1234 /n > nul

    if errorlevel 4 goto nextx

    if errorlevel 3 goto menu

    if errorlevel 2 goto store

    if errorlevel 1 goto fight

    :fight

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have encountered a dragon

    pause

    cls

    echo Press enter to hit the dragon

    set /p hit=

    set /a new=%new%-%damage%

    if %new% LSS 1 (

    goto defeat

    )

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have hit the dragon

    echo The dragon lost %damage% health

    pause

    cls

    echo The dragon has hit you!

    set /a health=%health%-%dd%

    if %health% LSS 1 (

    goto defeated

    )

    pause

    cls

    goto fight

    :defeat

    cls

    set /a dh=%dh%+20

    set /a new=%dh%

    set /a money=%money%+100

    set /a levels=%levels%+1

    echo You defeated the dragon and earned $100.

    echo Congratz

    pause

    goto start

    :defeated

    cls

    echo Sorry You died!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    echo RIP

    echo You have killed %levels% dragon

    pause

    goto menu

    :store

    cls

    echo Money:%money%

    echo Welcome to the store!

    echo Choose:

    echo 1.Sword Upgrade$700

    echo 2.Heal Potion$30

    echo 3.Leave Store

    choice /c:123 /n > nul

    if errorlevel 3 goto start

    if errorlevel 2 goto buyheal

    if errorlevel 1 goto buysword

    :buysword

    cls

    set /a money=%money%-700

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+700

    pause

    goto store

    )else (

    set /a damage=%damage%+5

    echo You have upgraded your sword

    pause

    goto store

    )

    :buyheal

    cls

    set /a money=%money%-30

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+30

    pause

    goto store

    )else (

    set /a potions=%potions%+1

    echo You have bought one heal potion

    pause

    goto store

    )

    :nextx

    cls

    if %potions%==0 (

    echo Sorry. You dont have any potions.

    pause

    goto start

    )else (

    set /a health=%health%+30

    set /a potions=%potions%-1

    echo You have used one potion and gained 30 health

    pause

    goto start

    )

    0
    None
    pingasj

    1 year ago

    i couldnt even upgrade my sword cos :buysword wasnt even a thing

    0
    None
    Hak3r213

    2 years ago

    Well, hopefully you made an update where your program doesn't crash after leaving the store because finding and fixing bugs in someone else's program is such a drag

    0
    None
    CodeSmartz

    3 years ago

    I have made an updated version, where you are allowed to hold the enter key:

    @echo off

    :menu

    color 0a

    cls

    echo DRAGON KILL

    echo Choose the number:

    echo 1. Start game

    echo 2. Exit

    echo Made by CodeSmartz and I_boom5245

    set /p menu=

    if '%menu%'=='1' (

    goto sets

    )

    if '%menu%'=='2' (

    exit

    )else goto menu

    :sets

    cls

    set /a money=1000

    set /a health=1000

    set /a potions=0

    set /a damage=2

    set /a dd=5

    set /a dh=25

    set /a moneygain=50

    set /a levels=0

    set /a new=%dh%+5

    :start

    cls

    echo Money:%money%

    echo Health:%health%

    echo Number of healing potions:%potions%

    echo Choose the number:

    echo 1. Venture onward to the dragon

    echo 2. Go to Store

    echo 3. Go to Title screen

    echo 4. Drink heal potion

    set /p choose=

    if '%choose%'=='1' (

    goto fight

    )

    if '%choose%'=='2' (

    goto store

    )

    if '%choose%'=='3' (

    goto menu

    )

    if '%choose%'=='4' (

    goto nextx

    )else goto start

    :fight

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have encountered a dragon

    pause

    cls

    echo Press enter to hit the dragon

    set /p hit=

    set /a new=%new%-%damage%

    if %new% LSS 1 (

    goto defeat

    )

    cls

    echo Health:%health%

    echo Dragon's Health:%new%

    echo You have hit the dragon

    echo The dragon lost %damage% health

    pause

    cls

    echo The dragon has hit you!

    set /a health=%health%-%dd%

    if %health% LSS 1 (

    goto defeated

    )

    pause

    cls

    goto fight

    :defeat

    cls

    set /a dh=%dh%+20

    set /a new=%dh%

    set /a money=%money%+50

    set /a levels=%levels%+1

    echo You defeated the dragon and earned $50.

    echo Congratz

    ping localhost -n 5 >nul

    pause

    goto start

    :defeated

    cls

    echo Sorry You died!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    echo RIP

    echo You have killed %levels% dragons

    ping localhost -n 5 >nul

    pause

    goto menu

    :store

    cls

    echo Money:%money%

    echo Welcome to the store!

    echo Choose:

    echo 1.Sword Upgrade$700

    echo 2.Heal Potion$30

    echo 3.Leave Store

    set /p again=

    if %again%==1 (

    goto buysword

    )

    if %again%==2 (

    goto buyheal

    )

    if %again%==3 (

    goto start

    )else goto store

    :buysword

    cls

    set /a money=%money%-700

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+700

    pause

    goto store

    )else (

    set /a damage=%damage%+4

    echo You have upgraded your sword

    pause

    goto store

    )

    :buyheal

    cls

    set /a money=%money%-30

    if %money% LSS 0 (

    echo You cant buy that!

    set /a money=%money%+30

    pause

    goto store

    )else (

    set /a potions=%potions%+1

    echo You have bought one heal potion

    pause

    goto store

    )

    :nextx

    cls

    if %potions%==0 (

    echo Sorry. You dont have any potions.

    pause

    goto start

    )else (

    set /a health=%health%+15

    set /a potions=%potions%-1

    echo You have used one potion

    pause

    goto start

    )